struct compatibility



Hi,

I'd like to know whether the following code is standard-compliant:


struct generic {
int x;
int a[1];
};


void f(struct generic *s)
{
int i;

for (i = 0; i < 10; i++)
s->a[i] = i;
}


int main(void)
{
struct special {
int x;
int a[10];
} s;

f((struct generic *) &s);

return 0;
}


Thanks,
Christian
.



Relevant Pages