LearnFrenzy
Sign in Take a free test

Basic Syntax and Data Types · Basic Syntax MCQ · Question 11

What is the type of 'A' in C++ (and in C)? Answer, explanation & discussion

  • MCQ
  • Medium
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links