Let's say that we have two C++ code snippets:
int x=3;
if(x)
{
//do stuff
}
int x=3;
if(x!=0)
{
//do stuff
}
Which one is more efficient in terms of computing speed? The first one is more convenient to write as it's shorter, but I'm not sure it's also faster.