Consider the following:
Code:
#include <stdio.h>
int main(void)
{
int x[50] = {2};
int i;
for (i = 0; i < 50; i++)
printf("x[%i] = %i\n", i, x[i]);
return 0;
}
and. . .
Code:
#include <stdio.h>
int main(void)
{
struct x {
int i, j, k;
} x = {2};
printf("x.i = %i, x.j = %i, x.k = %i\n", x.i, x.j, x.k);
return 0;
}
What do you THINK this will do?
I have tried this and didn't get the results that I thought would happen. What I'm attempting to figure out is whether it is my compiler or me that has gone off the deep end.
Thanks,
Andy