1、#define宏是纯文本扩展。
比如#define a (x) DoSomething(x)
则a(y)展开后变成(x) DoSomething(x)(y)
2、typedef是定义类型名,但是它没有扩展性。
如typedef int apple;
unsigned apple a;//error
1、#define宏是纯文本扩展。
比如#define a (x) DoSomething(x)
则a(y)展开后变成(x) DoSomething(x)(y)
2、typedef是定义类型名,但是它没有扩展性。
如typedef int apple;
unsigned apple a;//error