Chapter 2. Variables and Basic Types
[2.1] beware: Float generally only guarantees 6 Valid digits, while double can ensure at least 10 digits. Therefore, double is better than float in ensuring computing accuracy.
Ex 2.3 34464 (warning c4305: "initialization": truncation from "Int" to "unsigned short. Actually 100000-65536)
Ex 2.4-31072 (100000-65536-65536)
Ex 2.9 which, if any, of the following are illegal? (C, d, e, f seems to be faulty)
(A) "who goes with f \ 145 rgus? \ 012 "(B) 3.14e1l (c)" two "L" some "(d) 1024f (e) 3.14ul (f)" multiple line comment
Ex 2.14 (a) int double = 3.14159; (B) Char _; (c) bool catch-22; (d) Char character or_2 = '1'; (e) float float = 3.14f; B and E are valid.
Ex 2.16 (a) int car = 1024, auto = 2048;
(B) int ival = ival; // correct (c) STD: CIN> int input_value; (d) double salary = wage = 9999.99; (e) double calc = calc ();
2.3.5 extern int I; // declares but does not define I, which is the role of extern.
Int I; // declares and defines I
Can be declaration multiple times, only one definition!
Chapter 3. Library types
Exercise 428-435 was not done.
Ex5.23 outputs 10 and 1.
Part I ends.