ProgrammingModerate

What is the value of sizeof("hello") in C?

  1. A. 5
  2. B. 7
  3. C. 1
  4. D. 6

Correct answer: D. 6

A string literal is an array of char one element longer than its visible text, because of the terminator.

More C Programming questions

Exams that ask this topic