dangling else

'dangling else' can also refer to...


More Like This

Show all results sharing this subject:

  • Computing


Show Summary Details

Quick Reference

The ambiguity that arises if a language allows constructs of the form ifb1then ifb2thenS1elseS2 in which it is not clear which if is associated with the else. Algol 60 resolved the ambiguity by forbidding the use of if immediately after then; Pascal, C, C++, and Java associate the else with the innermost if. Ada avoids the problem by pairing each if with an explicit end if.

ifb1then ifb2thenS1elseS2

Subjects: Computing.

Reference entries

Users without a subscription are not able to see the full content. Please, subscribe or login to access all content.