About GBdirect Consultancy Training Development

Section navigation

Leeds Office (National HQ)

GBdirect Ltd
Leeds Innovation Centre
103 Clarendon Road
LEEDS
LS2 9DF
West Yorkshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

South East Regional Office

GBdirect Ltd
18 Lynn Rd
ELY
CB6 1DA
Cambridgeshire
United Kingdom

consulting@gbdirect.co.uk

tel: +44 (0)870 200 7273
Sales: 0800 651 0338

Please note: Initial enquiries should always be directed to our UK national office in Leeds (West Yorkshire), even if the enquiry concerns services delivered in London or South/East England. Clients in London and the South East will typically be handled by staff working in the London or Cambridge areas.

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.