Okay dudes back for yet another semester of mind bending programming. Anyhow dudes I totally forgot something from last semester. I was just wondering if anyone out there could refresh my memory on how to build a structure with an array of entries.
Okay dudes back for yet another semester of mind bending programming. Anyhow dudes I totally forgot something from last semester. I was just wondering if anyone out there could refresh my memory on how to build a structure with an array of entries.
That looks about right...Code:struct foo { int array[10]; } bar[10], *baz; int x, y; /* since I don't know exactly what you are stuck on... */ for( x = 0; x < 10; x++ ) for( y = 0; y < 10; y++ ) bar[x].array[y] = x * 10 + y; /* and of course, via pointers... */ baz = bar; for( x = 0; x < 10; x++, baz++ ) for( y = 0; y < 10; y++ ) baz->array[y] = x * 10 + y;
Quzah.
Hope is the first step on the road to disappointment.
Another solution is STL vector container.
Kuphryn