Professional Documents
Culture Documents
Hermosilla
-The term string generally means an ordered sequence of characters, with a first character, a second
character, and so on, and in most programming languages such strings are enclosed in either single or
double quotes. In C++ the enclosing delimiters are double quotes.
First, declare a variable to receive string values by typing “string”, then the variable, then a semicolon (;).
Example:
string str1;
string str2;
3. How do you input and output strings in C++ programming? Give Examples.
By following the format cout << variable;