ProgrammingModerate

char *s = "hi"; s++; printf("%s", s); What is printed?

  1. A. i
  2. B. hi
  3. C. h
  4. D. ih

Correct answer: A. i

s is a pointer to the string literal, and incrementing it moves to 'i' before the terminator.

More C Programming questions

Exams that ask this topic