I have a 2D array, and I want to use initializer to initialize it in my constructor. I want all of my array elements to have the same values. This is what I have:
private:
struct Something {
string x
double y;
int z;
};
Something array[50][50];
class::class() : array{ "wow", 2.4, 8 } {
}
I have tried method above in my code but was only assigning the first element to be what I want. Should I assign every element by using loop with the initializer along? Thank you.