Q:

The size member returns the length of a string (i.e., the number of characters in it). We can use size to print only lines longer than 80 characters

0

The size member returns the length of a string (i.e., the number of characters in it). We can use size to print only lines longer than 80 characters.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

string line;
// read input a line at a time and print lines that are longer than 80 characters
while (getline(cin, line))
if (line.size() > 80)
cout << line << endl;

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now