Typedef in C language

Description:

******Use the typedef keyword to define a new data type.

***For example: typedef unsigned short U16, when defining variables, the definition of unsigned short a and U16 a are equivalent.

****** It is not recommended to use #define to define new data types, because #define cannot handle pointer types correctly

***如:#define   ptr_to_char   char *

     ptr_to_char a,b; ------>It is actually char *a,b; #define is just a simple replacement.

Guess you like

Origin blog.csdn.net/wzc18743083828/article/details/26705499