PaulS:
int pattern[][5];
The size of an array can be omitted only when the size can be inferred from the number of initializers present. There being no initializers, the first size of the array is 0.
error: too many initializers for 'int [0][5]'
See, the compiler told you that.
How many initializers did you define when you tried to initialize the instance? More than 0? Yes. That's too many.
What's so hard to understand about that?
Ok, true... My bad for posting a poor question. What I really wanted was that array to be able to take something with like 7 elements as well.
So applying the fix int pattern[5][5]; just won't cut the cheese.
struct s {
char c;
int i;
int pattern[][5];
};
struct s a = {'a', 5, {{1, 1, 1, 1, 0}, {1, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {1, 1, 1, 1, 0}}};
struct s b = {'b', 7, {{1, 1, 1, 1, 0}, {1, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {1, 1, 1, 1, 0}, {1, 1, 1, 1, 0}, {1, 1, 1, 1, 0}}};
So how can I accomplish what I intend by the code above?
/Pelle