vendredi 7 août 2015

why assigning three == signs inside if statement in c doesnot work? [duplicate]

This question already has an answer here:

i have a code like this: int naxes1[1] = {6}; int naxes2[1] = {6}; int naxes3[1] = {6};

if (naxes1[0]  == naxes2[0] == naxes3[0])
    printf("first doesnot work\n");

if (naxes1[0]  == naxes2[0] && naxes1[0]== naxes3[0])
    printf("second works\n");

why?

Aucun commentaire:

Enregistrer un commentaire