C++ primer exercise 2.4.2

Please help ?
Exercise 2.27 -
Which of the following initializations are legal? Explain why.
a) int i = -1, &r = 0;
b) int *const p2 = &i2;
c) const int i = -1, &r = 0;
d) const int *const p3 = &i2;
e) const int *p1 = &i2;

Exercise 2.28 : Explain the following definitions, Identify any that are illegal.
a) int i, *const cp;
b) int *p1, *const p2;
c) const int ic, &r = ic;
Last edited on
Topic archived. No new replies allowed.