如果在C++中使用Macro,要注意:
1. parameter要加括号: #define ADD(x,y) ((x)+(y))
2. result要加括号: #define ADD(x,y) ((x)+(y))
3. 多行要加花括号: #define INCREASE(a, b) {++(a);++(b);}

这里有个例子:https://github.com/fresky/MacroExample

相关文章:

  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-06-14
  • 2022-12-23
  • 2022-12-23
  • 2021-10-23
  • 2021-05-11
猜你喜欢
  • 2022-03-06
  • 2022-01-10
  • 2021-12-14
  • 2021-07-16
相关资源
相似解决方案