Okay, you can still use copy, like this:
1 2 3 4 5 6 7 8 9 10
|
//...
Struct * array=new Struct[N];
//...
Struct * array2=new Struct[N];
copy(array,array+N,array2);
//...
|
Or... Is this an initialization problem? If it's an initialization problem
and all the elements of the array are supposed to have the same,
specific value, you could use the fill_n function, like this:
1 2 3 4 5 6 7 8 9 10
|
//...
Struct element;
//set element's value somehow...
Struct * array=new Struct[N];
fill_n(array,N,element);
//...
|
http://cplusplus.com/reference/algorithm/fill_n/
If it's an initialization problem but the value of each element
depends on its position in the array, I'm afraid you have to
resort to loops. There are still things you can do though.
For example, writing constructors for your structs could help.
EDIT: Wow... I've been writing this reply for more than 15 minutes...