Google News
logo
CPP - Quiz(MCQ)
What is the size of a character literal in C and C++?
A)
1 and 1
B)
1 and 4
C)
4 and 1
D)
4 and 4

Correct Answer :   4 and 1


Explanation : The size of a character literal is 4 in case of C but it is one in case of C++. You can do printf(“%d”, (int)sizeof(‘a’)); in both C and C++ to check this.

Advertisement