<分区>
Possible Duplicate:
What is the difference between these (bCondition == NULL) and (NULL==bCondition)?
来自 this question它说“比较左侧的常量对象”比其他方式“更好”。这是为什么?
<分区>
Possible Duplicate:
What is the difference between these (bCondition == NULL) and (NULL==bCondition)?
来自 this question它说“比较左侧的常量对象”比其他方式“更好”。这是为什么?
最佳答案
任何体面的编译器都会警告您有关条件表达式中的赋值,因此如今这种形式不是很相关。
On another point "use unsigned for variables that are >= 0 // nice trick " I heard that using unsigned can be confusing and shouldn't use unless there's a reason. Does anyone agree or refute this?
当值应该是 unsigned
时使用 unsigned
。
关于c++ - C++ 中的正确形式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12205028/