Example Using
length
and
size
•
Example:
string
firstName;
string
fullName;
firstName = “Alexandra”;
cout
<< firstName.length() <<
endl
;
// Prints 9
fullName = firstName + “ Jones”;
cout
<< fullName.length() <<
endl
;
// Prints 15