Mail Archives: djgpp/1997/10/23/12:16:51
In article <199710130605 DOT TAA20415 AT fep1-orange DOT clear DOT net DOT nz>,
"Jamie Love" <jamie DOT love AT clear DOT net DOT nz> 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
- Raw text -