1 / 3
Aug 2011

Below are 2 conditional operations. I just want to know the difference between them and which one "ll be a better programming practice and why?

if(i==0)

and

if(0==i)

...

  • created

    Aug '11
  • last reply

    Aug '11
  • 2

    replies

  • 181

    views

  • 2

    users

The second is "better" in practice. If you forget to put two equal signs( which can happen if you type very fast for example ), it will generate an error, you are assigning a value to a constant.

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 17 10d

Want to read more? Browse other topics in C and C++ or view latest topics.