I thought I should get a compilation error for the following char allData strong> array definition :
void MyClass::aMethod(const char* data, int size)
{
int headerSize = 50;
MyHeader header;
char allData[size + headerSize];
memcpy(allData, &header, headerSize);
memcpy(allData + headerSize, data, size);
....
}
Why? Will this give a runtime error?
source
share