lundi 4 mai 2020

Why is 1 the value of the variable var after entering the if-statement?

Here you can see the listing:

int var = 0;
if(var = -5 || 5)
{
    // Value of var is 1, but why? Shouldn´t it be -5 or 5?
    printf("%d", var);
}

Aucun commentaire:

Enregistrer un commentaire