EXERCISES SECTION 2.3.1
Exercise 2.15: Which of the following definitions, if any, are invalid Why
(a) int ival = 1.01; (b) int &rval1 = 1.01;
(c) int &rval2 = ival; (d) int &rval3;
Exercise 2.16: Which, if any, of the following assignments are invalid If they are valid, explain what they do.
- int i = 0, &r1 = i; double d = 0, &r2 = d;
(a) r2 = 3.14159; (b) r2 = r1;
(c) i = r2; (d) r1 = d;
Exercise 2.17: What does the following code print
- int i, &ri = i;
- i = 5; ri = 10;
- std::cout << i << " " << ri << std::endl;