Question 11
Back to Exercise
What is the type of the character literal 'A' in C++?
- A int, as in C
- B char Correct
- C string
- D wchar_t
Correct Answer: Option B
In C++ 'A' is a char, so sizeof('A') is 1 and overloads taking char are chosen. In C it is an int.
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!