   vector in header file?
  Hi guys.What's wrong with the following code.in a c++ header file#include <vector>class SomeClass{   private: vector<float> myVector;   public: SomeClass();}If I do need to define a vector as a private variable, how would I do that? thanks   
  Do you need to include the "std::" before vector<float>?std::vector<float> myVector;Also a semicolon after closing the class.   ;std::vector<float> myVector;   ;  You didn't mention what error you're getting, but I'm assuming the problem is this line:vector<float> myVector;vector is in the std namespace, so you need to qualify it as follows:std::vector<float> myVector;;Quote:Original post by karwostsDo you need to include the "std::" before vector<float>?std::vector<float> myVector;Also a semicolon after closing the class.That's a really prompt reply. Thanks a lot.It is really strange. Previously, I tried to use the namespace std, but it didn't work. Therefore I didn't think the std::vector would work. But now both ways work fine.   ;Quote:Original post by mylifemysoulIt is really strange. Previously, I tried to use the namespace std, but it didn't work.Odd, that should have worked but its a bad idea to use that. Never put using namespace into a header file.;Quote:Original post by mylifemysoulQuote:Original post by karwostsDo you need to include the "std::" before vector<float>?std::vector<float> myVector;Also a semicolon after closing the class.That's a really prompt reply. Thanks a lot.It is really strange. Previously, I tried to use the namespace std, but it didn't work. Therefore I didn't think the std::vector would work. But now both ways work fine.MSVC 6.0 was superceded about a generation ago.   ;Quote:Original post by BregmaMSVC 6.0 was superceded about a generation ago.And coffee contains caffeine.Neither are particularly relevant to his question,   ;  Except that using MSVC 6.0 is a possible reason why playing fast and loose with namespaces might not have caused an error that it should have.Anyway, I think we're done here, yeah?   ;Quote:Original post by ZahlmanExcept that using MSVC 6.0 is a possible reason why playing fast and loose with namespaces might not have caused an error that it should have.Anyway, I think we're done here, yeah?It's equally possible he did a using namespace std; before including the headerfile. These things gets missed a lot.   