vendredi 26 février 2016

C++ if statement notation - Is this equivalent?

I'm 99% sure this won't work but that remaining 1% is bothering me

    int x;

    //is this if statement

    if(x == 1, 5, 7)
    {
    //do something here
    }
    //equivalent to this if statement

    if((x == 1) || (x == 5) || (x == 7))
    {
    //do something here
    }

Aucun commentaire:

Enregistrer un commentaire