typedef

Allows a user defined alias to be used based on existing data types.

 

The typedef keyword is followed by an existing data type and the user defined name, and is then used as an alias of the declaration.

 

typedef unsigned short USHORT ;

 

Thus USHORT is now an alias for the longer 'unsigned short' data type.

 

USHORT myVar = 2 ;

 

instead of writing:

 

unsigned short myVar = 2 ;

Leave a Reply