In C, what is the type of the character constant ‘A’?
Correct answer C. int
Explanation
In C an integer character constant such as 'A' has type int, so sizeof('A') equals sizeof(int), usually 4. This is a well-known difference from C++, where 'A' has type char and sizeof('A') is 1. The value is the character's code, 65 in ASCII, and it is converted to char only when you store it in a char variable.
Answer checked How we write and check questions
Discussion