#define
是一种机械的文本替代,typedef
(C/C++),using
属于(C++),using
不仅可以做typedef
的事情,还可以做typedef
不能做的事情。无论是typedef
还是using
,都是取一个类型别名。
#define
知识补充:
- #define定义宏函数会出现的问题:
#define SQUARE(x) x*x
int main()
{
int a = 2;
std::cout
关注
打赏