i'm just writing a small class now and i want a few vectors as private data. if i use the line
then there's no problem. But i want to declare that this vector should contain say, 32 elements, and that they are all initialise3d to 0, so i tried
but it won't let me and errors with some
std::vector<int> a(32, 0);
How can i specify the size and initial contents of the vector?
error C2059: syntax error : 'constant'
I don't get any errors if i use code like this in an ordinary program. Is there something special happening here cause it's in the private data section of a class?
Any ideas would be great.