MCQ Hive stays free thanks to ads. Please disable your ad blocker for this site so content and features keep working.
Data Types
Primitive Types & Sizes
Beginner
Q
In C++, what is sizeof(char)?
AAlways 8
BAlways 1, by definition
CDepends on the compiler (1, 2, or 4)
D2 on Unicode systems
Correct Answer:
B. Always 1, by definition
Explanation:
sizeof is measured in units of char, so sizeof(char) is 1 by definition. The number of bits in a char (CHAR_BIT) can vary, but is usually 8.