[Tutorial] Una pequeсa idea sobre operadores ternarios
#7

Quote:
Originally Posted by Fornew
View Post
Esto

Code:
if(Condicion == 1)
    {
        // SI SE CUMPLE EN 1
    }
    else if(Condicion == 2)
    {
        // SI SE CUMPLE EN 2
    }
    else 
    {
        // SI NO SE CUMPLE NINGUNO
    }
їSe puede hacer con switch?
Si, y seria mas veloz.

Code:
switch(Condicion)
{
case 1:{} // SI SE CUMPLE EN 1
case 2:{} // SI SE CUMPLE EN 2
default:{} // NO SE CUMPLEN
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)