0 votes
31 views
asked in C++ by

Hi All

  Effective use of == in c++?

1 Answer

0 votes
answered by
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

Categories

...