由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - what's the difference
相关主题
does any one know the answer?what is difference between 0x0008 and 8?
Any difference between class and typename identifier?a question
How does YAHOO calculate RSI? (转载)问一个比较
请教一个design的问题我也问个UDP网络编程中遇到的问题
one interview questionWhat is the difference between WM_close and WM_CLOSE?
difference between FILE and struct FILE[合集] What are the differences between "const char* p" and "c
What is the difference between operator new and the newplacement new
c++下如何实现多线程?Dreamweaver 能不能象Word一样, WYSIWYG ?
相关话题的讨论汇总
话题: difference话题: max话题: value话题: what话题: return
进入Programming版参与讨论
1 (共1页)
l******n
发帖数: 9344
1
Is there a difference between the "if" tests shown below? If so, explain
why one might be preferred over the other.
if (*p == MAX_VALUE) return -1;
if (MAX_VALUE == *p) return -1;
thanks
o******r
发帖数: 259
2
no difference.
second is preferred.
why?
because you can't take = as == by mistake.

【在 l******n 的大作中提到】
: Is there a difference between the "if" tests shown below? If so, explain
: why one might be preferred over the other.
: if (*p == MAX_VALUE) return -1;
: if (MAX_VALUE == *p) return -1;
: thanks

1 (共1页)
进入Programming版参与讨论
相关主题
Dreamweaver 能不能象Word一样, WYSIWYG ?one interview question
c的memory layout和c++的memory layout有什么不同?difference between FILE and struct FILE
what's the difference between a .cpp file and a compilation unit?What is the difference between operator new and the new
interview question: what is the difference between Java and c++c++下如何实现多线程?
does any one know the answer?what is difference between 0x0008 and 8?
Any difference between class and typename identifier?a question
How does YAHOO calculate RSI? (转载)问一个比较
请教一个design的问题我也问个UDP网络编程中遇到的问题
相关话题的讨论汇总
话题: difference话题: max话题: value话题: what话题: return