Question: As noted in Section 6.4.2, languages vary in how they handle the situation in which the controlling expression in a case statement does not appear
As noted in Section 6.4.2, languages vary in how they handle the situation in which the controlling expression in a case statement does not appear among the labels on the arms. C and Fortran 90 say the statement has no effect. Pascal and Modula say it results in a dynamic semantic error. Ada says that the labels must cover all possible values for the type of the expression, so the question of a missing value can never arise at run time. What are the tradeoffs among these alternatives? Which do you prefer? Why?
Step by Step Solution
3.26 Rating (161 Votes )
There are 3 Steps involved in it
The tradeoffs among these alternatives depend on the specific needs and goals of the programming lan... View full answer
Get step-by-step solutions from verified subject matter experts
