Chapter 2Exercise 2.1Trigraphs are used when the input device used, or the host system's native character set, do not support enough distinct characters for the full C language. Exercise 2.2Trigraphs would not be used in a system that has enough distinct characters to allocate a separate one to each of the C language symbols. For maximum portability, one might see a trigraph representation of a C program being distributed, on the grounds that most systems which do not use ASCII will be able to read ASCII coded data and translate it into their native codeset. A Standard C compiler could then compile such a program directly. Exercise 2.3White space characters are not equivalent to each other inside strings and character constants. Newline is special to the preprocessor. Exercise 2.4To continue a long line. Especially in systems that have an upper limit on physical line length. Exercise 2.5They become joined. Exercise 2.6Because the Exercise 2.731 characters for internal variables, six for external variables. The six character names must not rely on distinction between upper and lower case, either. Exercise 2.8A declaration introduces a name and a type for something. It does not necessarily reserve any storage. Exercise 2.9A definition is a declaration that also reserves storage. Exercise 2.10It is always the case that the largest range of values can be held in a long double, although it may not actually be any different from one of the smaller floating point types. Exercise 2.11The same answer holds true for the type with the greatest precision: long double. C does not permit the language implementor to use the same number of bits for, say, double and long double, then to allocate more bits for precision in one type and more for range in the other. Exercise 2.12There can never be problems assigning a shorter floating point type to a longer one. Exercise 2.13Assigning a longer floating type to a shorter one can result in overflow and undefined behaviour. Exercise 2.14Undefined behaviour is completely unpredictable. Anything may happen. Often, nothing seems to happen except that erroneous arithmetic values are produced. Exercise 2.15
Exercise 2.16
Exercise 2.17
|
The C BookThis book is published as a matter of historical interest. Please read the copyright and disclaimer information. GBdirect Ltd provides up-to-date training and consultancy in C, Embedded C, C++ and a wide range of other subjects based on open standards if you happen to be interested. |
|
West Yorkshire Office
GBdirect Ltd
Training: 0800 651 0338 Please call between 0900 and 1700 (UK time) on Monday to Friday South East Regional Office
GBdirect Ltd
Training: 0800 651 0338 Please call between 0900 and 1700 (UK time) on Monday to Friday Please note: |