hi!
there is a class:
//but it gives this error:
//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<cla ss std::basic_stri ng<char,struct std::char_trait s<char>,class std::allocator< char> >,class std::allocator< class std::basic_stri ng<char,struct std::char_trait s<char>,class std::allocator< char> > > > card::names" (?names@card@@2 V?$vector@V?$ba sic_string@DU?$ char_traits@D@s td@@V?$allocato r@D@2@@std@@V?$ allocator@V?$ba sic_string@DU?$ char_traits@D@s td@@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?
there is a class:
Code:
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<cla ss std::basic_stri ng<char,struct std::char_trait s<char>,class std::allocator< char> >,class std::allocator< class std::basic_stri ng<char,struct std::char_trait s<char>,class std::allocator< char> > > > card::names" (?names@card@@2 V?$vector@V?$ba sic_string@DU?$ char_traits@D@s td@@V?$allocato r@D@2@@std@@V?$ allocator@V?$ba sic_string@DU?$ char_traits@D@s td@@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?
Comment