typedef Declarations

Syntax: typedef <data_type> <alias>

In C/C++ it is possible to declare an 'alias' data type for a built-in or user-defined data type. This is accomplished by using the typedef declaration. For example...

typedef int BOOLEAN;
BOOLEAN flag;

Creates an alias named BOOLEAN for the int built-in data type. The second statement defines a variable flag of type BOOLEAN. This provides a more meaningful data type for the variable, which presumably, will be used to store boolean data values




Back to Declarations/Definitions Page
Back to Header File Page