Utilizor
Contact Us

C++ Strings

Working with text.

C++ Strings

Strings are used for storing text.

A string variable contains a collection of characters surrounded by double quotes.

To use strings, you must include an additional header file in the source code, the <string> library:

String Concatenation

The + operator can be used between strings to add them together to make a new string. This is called concatenation.

You can also use the append() function to add a string to the end of another string.