Say I have a structure:
struct foo{
int field_1;
int field_2;
};
And say have an array:
foo bar[1000];
I understand that you can initialise arrays like this:
foo bar[]={
{ .field_1= 10, field_2 = 20 },
{ .field_1= 30, field_2 = 40 },
};
This is not practical at all when the array has 1000 elements. I need to initialise all elements to a specific integer (at compile time) but it looks like it is not practically possible to do this unless the array is very small. It seems like an essential thing to be able to do but I can't find a solution.
Thanks.