const typedef #define

const :

  const修饰的什么,什么不会变。例如  int b=500;

  int const *a=b;const修饰*a 则*a不会变,而a可以变

  int * const a=b;const修饰a 则a不会变,而*a可以变

  看const修饰的是什么时,先把类型名去了再看

typedef: 给类型别名

  typedef int  typename;

#define : 应尽力不使用· 

  #define a = 5.1235846 定义常量时,没有指明类型,易出错;

#define 没有参加编译,在预处理的时候就被替换掉了。
typedef参加编译和链接。
typedef是重命名,可以为枚举结构体等等重新命名,提高代码整洁。

using:C++11标准

  using AAA = int; AAA就代表int了

   

  

原文地址:https://www.cnblogs.com/Sky-Aces/p/8519696.html