Introduction to C++
In addition to numbers (
double etc.) and symbols(
char) in variables, you can also store text. For this, you need to:
- Connect the
- Get the
stringobject from the
- Declare a variable of type
\n – is the new line symbol (same as
endl, but a symbol).
Strings variables can also contain numbers (as text):
If you try to add two string variables, you get a concatenation:
The same thing will happen with numbers – they will not be added algebraically.
To find out the length of a string, we can use the standard