Folks,
I'm in a scenario whereby I will often be inputing 10 elements but sometimes it might be more that 10 elements.
So i decided to use vectors, so that if I needed to read in more than 10 elements, then the vector will grow automatically without too much work from myself.
Now the element that I'm read in, is for a class called CHARACTER. So when defining the vector of my class CHARACTER, I wish to define it initially with as a vector of size 10. This is what I attempted below.
However, I keep getting a syntax error as below:-Code:vector<CHARACTER> char_list(10);
c:\autochar\turn_data.h(29) : error C2059: syntax error : 'constant'
main.cpp
c:\autochar\turn_data.h(29) : error C2059: syntax error : 'constant'
Any ideas of what I'm doing wrong ? (sorry for the basic question but I'm still very new to vectors and the other classes in the STL.
Cheers
Starkhorn



LinkBack URL
About LinkBacks


