vectorstd::string

Started by
3 comments, last by fitfool 15 years, 11 months ago
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?
Advertisement
Class A
should be
class A


And vector is located in std namespace, so std::vector<int>.
vector<std::string> vecOfString;
Should be:
std::vector<std::string> vecOfString;

EDIT: Too slow (And what Antheus said about 'class')
I realisedmy mistake. Thanks both
Dont forget a ';' after your end bracket too.

This topic is closed to new replies.

Advertisement