Newsgroups: comp.lang.c Path: utzoo!utgpu!watserv1!watdragon!dahlia!dsebbo From: dsebbo@dahlia.uwaterloo.ca (David Ebbo) Subject: Re: initialization of automatic structures/unions Message-ID: <1991Mar2.022652.24587@watdragon.waterloo.edu> Sender: daemon@watdragon.waterloo.edu (Owner of Many System Processes) Organization: University of Waterloo References: <13599@life.ai.mit.edu> Date: Sat, 2 Mar 1991 02:26:52 GMT Lines: 19 In article <13599@life.ai.mit.edu> filisa@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.