With if statements it is possible to check the return of an integer function. The function gets executed within this.
if(!yourfunction)
{
do something;
}
else
{
do something else;
}
The very same thing in switch however, won't even execute the function. Why?
switch(yourfunction())
{
case 1:
do something;
case 0:
something else;
}
Aucun commentaire:
Enregistrer un commentaire