Im trying something like this (which doesnt compile):
struct mystruct {
somestruct arr[4];
mystruct(somestruct val) : arr[0](val), arr[1](val), arr[2](val), arr[3](val) {}
};
How is this best done in c++ ?
Note: i might want to set only some of the array elements with this method.
In C++11, if you want to set all the elements:
In C++03, or C++11 if you only want to set some elements: