From: md3den AT mdstud DOT chalmers DOT se (Dennis Bjorklund) Newsgroups: comp.os.msdos.djgpp Subject: Re: Difference between struct setups Date: 23 Oct 1997 07:03:39 GMT Organization: Chalmers University of Technology Lines: 38 Message-ID: <62mssb$rc0$n@195.26.68.19> References: <199710130605 DOT TAA20415 AT fep1-orange DOT clear DOT net DOT nz> NNTP-Posting-Host: 195.26.68.19 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <199710130605 DOT TAA20415 AT fep1-orange DOT clear DOT net DOT nz>, "Jamie Love" writes: JL>typedef struct X JL> { JL> ..... JL> } X; JL>.. JL>X x; This is the way you often use in C. (but it works in C++ too) JL>Now, when i was programming in borlands compiler, i just went: JL> JL>struct X JL> { JL> ..... JL> }; JL>.. JL>X x; And this only works in C++. If this had been C then you would have to write "struct X x" istead of "X x". So it works in djgpp if you compile it as a C++ program. The C example above typdefs the name X to be the structure. So you can write just X x. In C++ this is done automaticly. JL>struct X JL> { JL> ..... JL> }y; This is valid in both C and C++. -- /Dennis