initialization of automatic structures/unions

David Ebbo dsebbo at dahlia.uwaterloo.ca
Sat Mar 2 13:26:52 AEST 1991


In article <13599 at life.ai.mit.edu> filisa at albert.ai.mit.edu (Filisa Vistima) writes:
>If such a construct such as this is illegal (says my compiler):
>
>	struct Stuff { int i, j, k, l; };
>
>	int main(argc, char ** argv)  {
>		struct Stuff stuffy = { 0, 0, 0, 0 };  /* illegal part */
>	}
>
>Can someone give me a good reason why initializing automatic
>structures/unions is illegal?
>
>Thanks.

It's not illegal.  You're just using a compiler that's not very standard.
Also, although this is not related to your problem, you forgot to give a type
to argc (i.e. you should have 'int argc').

David Ebbo.



More information about the Comp.lang.c mailing list