What does the increment change?

A C programmer tests two expressions with the same initial data. Each block executes independently, with a fresh array and pointer. Fill in the exact integer values after each block finishes.


First block:


C
int readings[] = {16, 29};
int *p = readings;
int saved = *p++;


After the first block, saved is and the integer obtained by evaluating *p is .


Second block:


C
int readings[] = {16, 29};
int *p = readings;
int saved = (*p)++;


After the second block, saved is and the integer obtained by evaluating *p is .

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Pointers Questions: