Skip to main content

Section 2.4 Character Data

In Python strings can be created with single or double quotes. In C++ single quotes are used for the character (char) data type, and double quotes are used for the string data type.
Consider the following code.
Try the following question.

Reading Questions Reading Question

1.

If I want to create a string in C++, what set of symbols may be used?
  • ’ ’
  • No, single quotes are only used for single characters.
  • " "
  • Good job reading!
  • ’ ’ or " " may be used
  • No. Only one set of symbols may be used.
  • It depends upon the implementation.
  • No. The implementation is consistent.
  • none of the above
  • One of the above is indeed correct.
You have attempted 1 of 4 activities on this page.