lundi 14 août 2017

Trouble with logic in very easy if-statement

So I cant figure out the logic behind this very simple if-statement

int found = 0, value = 5;
if (!found || ‐‐value == 0)
cout << "danger ";
cout << "value = " << value << endl;

Why does "danger" being written to the screen here? I thought since found = 0, !found is not euqual to zero.

Aucun commentaire:

Enregistrer un commentaire