Jump to content
  • Advertisement
Sign in to follow this  
TigerSam

vectorstd::string

This topic is 3869 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, When i try to create a vector<std::string> vecOfString i get a load of compile errors which i dont understand. my code is: //A.h #include <vector> #include <string> Class A { public: ... ... vector<std::string> vecOfString; ... private: .... } usual errors: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int error C2238: unexpected token(s) preceding ';' error C2143: syntax error : missing ';' before '<' What im trying to do is legal isnt it?

Share this post


Link to post
Share on other sites
Advertisement
vector<std::string> vecOfString;
Should be:
std::vector<std::string> vecOfString;

EDIT: Too slow (And what Antheus said about 'class')

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!