cpp/basics/define_and_inline #50
Replies: 3 comments
-
最后那里x++不会运行两次。对于(x++) > 10 ? (x++) : 10,x = 1,因为1 < 10,所以结果会返回10,后面的x++不会运行。 |
Beta Was this translation helpful? Give feedback.
-
#define MAX(a, b) ((a) > (b) ? (a) : (c)) int x = 1; |
Beta Was this translation helpful? Give feedback.
-
#include // 宏定义 x++ 会被执行两次, 因为 x++ 会被替换到两个地方,使用内联函数则不会出现这个问题 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
cpp/basics/define_and_inline
编程指北: 计算机系统学习指南, 操作系统, 计算机网络, C++, Java, 算法, 数据结构
https://csguide.cn/cpp/basics/define_and_inline.html
Beta Was this translation helpful? Give feedback.
All reactions