If I have:
struct a_struct { int an_int; a_struct(int f) : an_int(f) {} a_struct() : an_int(0) {} }; class a_class { a_struct * my_structs;
If using the STL is an option, you could use std::vector instead of a dynamic array.
I think that this will work:
std::vector my_structs; my_structs.assign(10, 1);
If not, this should:
my_structs.assign(10, a_struct(1));