Strings and Escape Sequences

Learn about string data type and escape sequences in C++.

String

String is plain text that represents alphanumeric data. A string comprises one or more characters. A character can be a letter, number, or space.

📝 Note: We consider string as text even if it contains a number. If that is so, then how can the string be distinguished from the actual code? To differentiate both, we always write string data inside double-quotes.

Example program

Try running the code below!

Get hands-on with 1400+ tech skills courses.