Structures and Other Data Forms
Structures and Other Data Forms
1 2
7 8
11 12
13 14
Typedef Typedef
Unlike #define, typedef is limited to Examples
giving symbolic name to types only and #define BYTE unsigned char
not to values typedef char * STRING;
Typedef interpretation is performed by typedef struct {double x,double y} rect;
the compiler, not the preprocessor rect r1 = {3.0,-6.0}; rect r2; r2=r1;
Whithin its limits, typedef is more
flexible than #define
17 18
Programming Exercises
Chapter 14
Exercise – 4 (Class List Structure)
Exercise – 8 (Colossus Airline)
Exercise – 11 (Function Pointers)
24