samedi 1 avril 2017

Can all if statements be converted to equivalent switch statements?

I think that all if statements like this

if(condition){statements;}

can be converted to a switch statement like this

switch(!(same condition as in if)){case 0:statements;}

Am I correct or is there some exception that cannot be converted from if to switch ?

Aucun commentaire:

Enregistrer un commentaire