1234567891011
// suppose I want to initialize s with "One","Two" and "Three". // what's the best way (minimum coding) to do it in C++03? class eggs{ private: string s[]; }; eggs::eggs() { // what am I supposed to do here? or perhaps in the declaration.. }
123456789101112
class eggs{ private: string s[3]; }; eggs::eggs() { s[0] = "One"; s[1] = "Two"; s[2] = "Three"; }
string s[] = {"one","two","three"};
12
eggs::eggs() : s{"one", "two", "three"} {}