LearnFrenzy
Sign in Take a free test

Basic Syntax and Data Types · Basic Syntax MCQ · Question 5

Which size is guaranteed by the C++ standard? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links