ProgrammingHard

int x = 1, y = 2; int *p = &x, **pp = &p; *pp = &y; printf("%d %d", x, *p); What is printed?

  1. A. 2 2
  2. B. 1 1
  3. C. 2 1
  4. D. 1 2

Correct answer: D. 1 2

*pp = &y changes p to point at y, but x is untouched. So x is 1 and *p is y, which is 2.

More C Programming questions

Exams that ask this topic