ProgrammingModerate

printf("%s", "abc" + 1); What is printed?

  1. A. abc
  2. B. bc
  3. C. b
  4. D. c

Correct answer: B. bc

The string literal decays to a pointer, and adding 1 starts the output at b.

More C Programming questions

Exams that ask this topic