Effective use of ==

0 votes
30 views
asked Dec 22, 2013 in C++ by code

Hi All

  Effective use of == in c++?

1 Answer

0 votes
answered Dec 22, 2013 by Er.Nathan
Use if statements like this if( 1 == count ) insteed of like this if ( count == 1). In case if you mistakenly put in just a single = signin the second case, like this: if( count = 1) //count will be assigned with 1 whereas if you made the same mistake with the constant value first: if( 1 = count ) //Will give Error
...