Re:Which one will execute faster, if(flag==0) or if(0==flag)?
by mynameishere on Friday January 07, 2011 @11:33PM
(#2082215)
No. If it matters you have a job involving oses or control systems or game engines and shouldn't be asking on stackoverflow.
[ Parent
| on HN ]
Re:Which one will execute faster, if(flag==0) or if(0==flag)?
by burgerbrain on Friday January 07, 2011 @11:56PM
(#2082282)
No, even then you're doing it wrong. Either: your compiler should optimize it properly and you shouldn't be worrying about it, or you shouldn't be doing it in C anyway.
If the difference between the two is actually important, then chances are your compiler is doing a myriad of other things significantly sub-optimally as well. Most likely far more sub-optimally than the difference between either of those.