仅用于记录学习过程
typedef 用于定义类型的别名
#define 既可用于为类型取别名,也可以定义常量等
typedef 在编译阶段有效
#define 是在预编译阶段
对指针操作时:
typedef int * pint;
#define PINT int *
int i1 = 1, i2 = 2;
const pint p1 = &i1; //p不可更改,p指向的内容可以更改,相当于 int * const p;
const PINT p2 = &i2; //p可以更改,p指向的内容不能更改,相当于 const int *p;或 int const*p