First page Back Continue Last page Graphics
const string
spaces(greeting.size( ), ' ');
Another instantiation of a object of type string.
This object is called spaces.
In this example, a different constructor is called.
- (num, character) returns num characters.
greeting.size() is a member function of the greeting object which returns an integer number for the length of the string stored in greeting.
Result is a set of spaces the same size as greeting.