mercredi 4 décembre 2019

OR Operation in if operation

I'm new in Native C Language but I didnt see an error.

Im trying to use a if operation in that Case:

#define PAGE_A 0 
#define PAGE_B 1

int pageID = 0;


if (pageID != PAGE_A || pageID != PAGE_B) {

    //Do something
}

But it dont work. If page ID = 0 or 1 it goes to "do something". If I just write:

if (pageID != PAGE_A) {

    //Do something
}

It works. If pageID = 1-x its goes to "do something" otherwise it dont...

Aucun commentaire:

Enregistrer un commentaire