ProgrammingModerate

printf("%d", (int)sizeof(char)); What is printed in C?

  1. A. 2
  2. B. 1
  3. C. 4
  4. D. 8

Correct answer: B. 1

The standard defines sizeof(char) as exactly 1 on every implementation, even where a char has more than 8 bits (CHAR_BIT > 8). 2 or 4 confuse it with a wide character or an int.

More C Programming questions

Exams that ask this topic