Compare length of two strings: Difference between revisions

Line 127:
if (!listOfStrings.empty())
{
char Q = '"';
string has_length(" has length ");
string predicate_max(" and is the longest string");
Line 148 ⟶ 149:
predicate = &predicate_ave;
 
cout << Q << *s << Q << has_length << length << *predicate << endl;
}
}
Line 162 ⟶ 163:
 
{{output}}
<pre>"123456789" has length 9 and is the longest string
"1234567" has length 7 and is neither the longest nor the shortest string
"abcdef" has length 6 and is neither the longest nor the shortest string
"abcd" has length 4 and is the shortest string
</pre>