Chapter 3

Exercise 3.1

They all give an int result with a value of 1 for true and 0 for false.

Exercise 3.2

They all give an int result with a value of 1 for true and 0 for false.

Exercise 3.3

They guarantee an order of evaluation: left to right, and stop as soon as the overall result can be determined.

Exercise 3.4

Break can be used to turn a switch statement into a set of exclusive choices of action.

Exercise 3.5

Continue has no special meaning in a switch statement, but only to an outer do, while or for statement.

Exercise 3.6

Inside a while statement, the use of continue may cause the update of the loop control variable to be missed. It is, of course, the responsibility of the programmer to get this right.

Exercise 3.7

Because the scope of a label doesn't extend outside the function that it lives in, you can't use goto to jump from one function to another. Using the longjmp library routine, described in Chapter 9, a form of function-to-function jump is supported, but not a completely general one.