Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What is the size of a character literal in C and C++?

a) 4 and 1
b) 1 and 4
c) 1 and 1
d) 4 and 4

Answer: a
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.

Join The Discussion