28.2 struct

I l @ ve RuBoard

In C++, when you declare a struct , you can use the structure as a type name . For example:

 struct sample {     int i, j;    // Data for the sample }; sample sample_var;  // Last sample seen 

C is more strict. You must put the keyword struct before each variable declaration:

 struct sample sample_var;  // Legal in C sample sample_var;          // Illegal in C 
I l @ ve RuBoard


Practical C++ Programming
Practical C Programming, 3rd Edition
ISBN: 1565923065
EAN: 2147483647
Year: 2003
Pages: 364

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net