Question 5
Back to Exercise
Which of these is guaranteed by the C++ standard?
- A sizeof(int) == 4
- B sizeof(char) == 1 Correct
- C sizeof(bool) == 1
- D sizeof(long) == 8
Correct Answer: Option B
sizeof(char) is 1 by definition. The others are typical but implementation-defined – long is 4 bytes on 64-bit Windows, for example.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!