ProgrammingModerate

int v = 10; int *p = &v; int **q = &p; **q += 5; printf("%d", v); What is printed?

  1. A. 15
  2. B. 10
  3. C. 5
  4. D. 20

Correct answer: A. 15

q holds &p, so *q is p and **q is v itself; **q += 5 updates v from 10 to 15. 10 assumes only a copy was changed through the pointers, and 20 doubles the value.

More C Programming questions

Exams that ask this topic