mercredi 18 mars 2015

c if statement check for zero

Is it recommended in c to write conditionals like this



if(foo != 0) {
// do stuff
}


Or like this



if(foo) {
// do stuff
}


I know they will always produce the same result, but which method is recommended for readability?


Aucun commentaire:

Enregistrer un commentaire