Possible duplicate:
Is there a way to initialize an array with mutable variables? (C ++)
I have the following code:
vector<vector<vec2>> vinciP; int myLines = -1; myLines = drawPolyLineFile("vinci.dat", vinciP); if (myLines > -1) { cout << "\n\nSUCCESS"; vec2 vPoints[myLines]; for (int i = 0; i < NumPoints; ++i) { vPoints[i] = vinciP[0][i]; } }
I get an error in the line vec2 vPoints [myLines]; that expressions must have a constant meaning. I do not understand why I get this error, any help?
Is it because myLines could be negative? Idk.
c ++ arrays vector visual-studio
y3di
source share