First code:
if(i==0) {// do instructions here}
Second code:
if(0==i) { // do instructions here }
What
For C++, it's possible, though unlikely, that there could be a difference. It depends upon what i's type is. e.g.
struct Foo
{
int x;
};
bool operator==(Foo lhs, int rhs)
{
return lhs.x == rhs;
}
bool operator==(int lhs, Foo rhs)
{
std::cout << "Hi!";
return true;
}
Someone who writes code like that should of course be shot.