I am using some existing code that someone else has written, and I cannot get it to compile (limited C experience here but I am trying to learn!).
utilities.
The error is correct. VLA(variable size arrays) are forbidden in C++. This is a VLA:
char filename1char[filenameLength];
What you probably meant is this:
char *filename1 = new char[filenameLength];
Which is not a VLA, but an array of char
s allocated on the heap. Note that you should delete this pointer using operator delete[]
:
delete[] filename1;