A typedef is typically used to declare struct-
1. Define some memory-friendly structures or make existing types appear more orderly, such as stdint.h that are added to the C + + standard header file later because they are used frequently
1typedef signedCharint8_t;2typedef Shortint16_t;3typedefintint32_t;4typedefLong Longint64_t;5typedef unsignedCharuint8_t;6typedef unsigned Shortuint16_t;7typedef unsignedintuint32_t;8typedef unsignedLong Longuint64_t;
Uint_8,uint_16,uint_32 this with unsigned numbers in the embedded or other underlying data processing has a sense of neat clean feeling. At the same time if there are certain although it is simple to define, but for the convenience of memory, for example we need to declare a 32-bit file number:
1 typedef Uint32 TFILEINDEX;
This way we declare the variables used to record the sequence number, Tfileindex Findex, can be implemented, but also to remind us of the role of this variable of life. Has a unique effect when dealing with the definition of multiple variables of the same structure.
2, good sleepy, follow-up re-fill
Use of typedef typedef struct