   vectors using
  Instead of using tables I'm trying to use some vectors on my application.I have included the following file  <vector>, but i've got the message "vector: undeclared identifier"I'm using VC++2005 Express. Does anyone know  what is  going on?Cheers !!   
  Did you remember that vector lives in the std namespace?   ;Quote:Original post by SiCraneDid you remember that vector lives in the std namespace?no, i did not...   ;  put "using std::vector;" under the "#include <vector>" line.  Or when you declare your vector, type: "std::vector< int > myVector;" for a vector of ints for example.   ;  you are right, it works now, but i've got another problem. basically i'm trying to declare some vectors in a class file.ann.hclass ann{   vector<float> v01_vect(1);};I have written the above lines. The compilers tells me that there is a syntax error, something must be constant...   ;  You're calling the vector's constructor, telling it to make there be one float in it, and you can't do that there.  Remove the (1).   ;Quote:Original post by Anonymous PosterYou're calling the vector's constructor, telling it to make there be one float in it, and you can't do that there.  Remove the (1).it works now.thanks   ;  This brings up exactly why C++ has the constructor initializer list:#include <iostream>#include <vector>class alpha{std::vector<float> f1;public:alpha() : f1(1) {std::cout << "constructor called" << std::endl;std::cout << f1.capacity() << std::endl; }alpha(unsigned int n) : f1(n) {std::cout << "constructor called" << std::endl;std::cout << f1.capacity() << std::endl; }};int main(){alpha instance1;alpha instance2(20);return 0;}