typedef与#define

来源:互联网 发布:fiiish旅行数据 编辑:程序博客网 时间:2024/05/22 06:38

1、#define宏是纯文本扩展。

比如#define a (x)  DoSomething(x)

则a(y)展开后变成(x)  DoSomething(x)(y)

2、typedef是定义类型名,但是它没有扩展性。

如typedef int apple;

unsigned apple a;//error

0 0
原创粉丝点击