c++ - Declaring an array of objects -
i have create array of objects have parameterized constructor in class initialization attributes of class. how in c++?
with "normal" initialization list?
example:
struct s { s(int, const std::string&) {} // dummy constructor }; s array_of_s[2] = { s(123, "foo"), s(456, "bar") };
Comments
Post a Comment