An array of structures in C...
- by 00010000
For the life of me I can't figure out the proper syntax for creating an array of structures in C. I tried this:
struct foo {
int x;
int y;
} foo[][] = {
{
{ 1, 2 },
{ 4, 5 },
{ -1, -1 }
},
{
{ 55, 44 }
{ 100, 200 },
}
};
So for example foo[1][0].x == 100, foo[0][1].y == 5, etc.…