I need to initialize an array of objects of a parametrized constructor . How can i do it in best possible way ?
# include # include&l
The C++ way would be to use a std::vector.
std::vector a1(10, 1);
creates 10 A's initialized by 1.
A
1