Hi!
I have the following struct:
I would like to turn char data[1024] to const char data[1024], the same goesCode:struct cBuffer { char data[1024]; int bytesRecorded; bool flag; cBuffer(char * data_, int bytesRecorded_, bool flag_) : bytesRecorded(bytesRecorded_), flag(flag_) { memcpy(static_cast<void *>(data), static_cast<void *>(data_), bytesRecorded * sizeof(char)); } };
for the constructor:
But then I fail using the memcpy() function because of the wrong cast.cBuffer(const char * data_, int bytesRecorded_, bool flag_)
how could I sort that out?
thanks




Reply With Quote