- 定义类型unsigned char
- 定义类型const unsigned char
- 定义类型到整数的指针
- 定义类型到字符的指针的指针
- 定义类型到字符数组的指针
- 定义类型7个到整数的指针的数组
- 定义类型到包含7个到整数的指针的数组的指针
- 定义类型包含8个数组的数组,其中每个数组包含7个到整数的指针
typedef unsigned char UnsignedChar;
typedef const unsigned char ConstantUnsignedChar;
typedef int* IntegerPointer;
typedef char** PointerPointerChar;
typedef char* PointerArrayChar;
typedef InterPointer Array7IntegerPointer[7];
typedef Array7IntegerPointer* PointerArray7IntegerPointer;
typedef IntegerPointer Array8Array7IntegerPointer[8][7];
使用原则:
使用typedef定义的类型需要使用特征显亮的名字,不应该使用含混晦涩的名字,过多的使用typedef有可能导致类型混乱。