vendredi 24 juin 2016

Nested one line if statements, else statements' precedence? [on hold]

If I create two nested one line if-statements, like this:

if (foo) if (bar) baz(); else qux();

And after that, one else-statement, like that ^

Which one of the foo and bar if-statements will the else-statement belong to/react to, and will this differ in different languages? (c++, c, c#, obj-c, java, python, php, javascript)

Aucun commentaire:

Enregistrer un commentaire