Date: Mon, 13 Oct 1997 15:27:45 +0200 (IST) From: Eli Zaretskii To: Jamie Love cc: djgpp AT delorie DOT com Subject: Re: Difference between struct setups In-Reply-To: <199710130605.TAA20415@fep1-orange.clear.net.nz> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 14 Oct 1997, Jamie Love wrote: > during my forays into the allegro code, i noticed that structs are set up > like: > > typedef struct X > { > ..... > } X; > ... > X x; > > Now, when i was programming in borlands compiler, i just went: > > struct X > { > ..... > }; > ... > X x; > > So, what is the difference?? The last line is not a legal C syntax. You need to say "struct X x;" instead. When you use typedef, you tell the compiler that type X is a kind of alias to "struct X". Please note that this discussion is a bit off-topic here; if you want to discuss it further, please post to comp.lang.c.