I have an array that I know the size because of a calcul. Something like : iSize = x-y; char c1[iSize];
But I have that error :expected constant expression :confused:
Printable View
I have an array that I know the size because of a calcul. Something like : iSize = x-y; char c1[iSize];
But I have that error :expected constant expression :confused:
I can't initialize an array with code like that ?
You can't do that in C/C++
I personally like link lists for problems like this.
But if you want to continue to use arrays you have to use pointers and use new to create a new array to your size and delete to destroy it when you are done with it.