The typedef facility is an advanced data feature that enables you to create your own name for a type. It is similar to #define in that respect, but with three differences:
Unlike #define, typedef is limited to giving symbolic names to types only and not to values.
The typedef interpretation is performed by the compiler, not the preprocessor.
Within its limits, typedef is more flexible than #define.
Let's see how typedef works. Suppose you want to use the term BYTE for one-byte numbers. You simply define BYTE as if it were a char variable and precede the definition by the keyword typedef.
typedef unsigned char BYTE;
From then on, you can use BYTE to define variables:
BYTE x, y, * z;
The scope of this definition depends ...