there is a class:
Expand|Select|Wrap|Line Numbers
- class card
- {
- static vector<string> names;
- //...
- };
- //i tried to initialize this way:
- vector<string> names.push_back("Two of Diamonds");
//error C2143: syntax error : missing ';' before '.'
//i tried to init in the ctor, but that is gave another error, a link error:
//Error : unresolved external symbol "public: static class std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > > card::names" (?names@card@@2V?$vector@V?$basic_string@DU?$char_ traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@ V?$basic_string@DU?$char_traits@D@std@@V?$allocato r@D@2@@std@@@2@@std@@A)
i have no idea how could i initialize the names variable with several stings
or... is it impossible?