A reasonable argument for c++ typedef

typedef int a[10];
typedef void (*p)(void);

They would think that a[10] is an alias for int, and (*p)(void) is an alias for void, but such an alias does not seem to be The legal name, so he fell into confusion. In fact, the above statement declares a as a type alias for an array with 10 int elements, and p is a type alias for a function pointer.
 

Guess you like

Origin blog.csdn.net/dxm809/article/details/114433269