The illustration shows a code segment with the lines numbered from 45 through 77 and the annotations are as follows:
"private:
char *value; //pointer to dynamic array that holds the string value.
int maxLength; //declared max length of any string value.
};
<The definitions of the member functions and overloaded operators go here.>
//Program to demonstrate use of the class StringVar.
void conversation(int maxNameSize);
//Carries on a conversation with the user.
int main( )
{
using namespace std;"
"conversation(30);" annotated as "Memory is returned to the freestore when the function call ends."
"cout << "End of demonstration.\n";
return 0;
}
//This is only a demonstration function:
void conversation(int maxNameSize)
{
using namespace std;"
"StringVar yourName(maxNameSize), ourName("Borg");" annotated as "Determines the size of the
dynamic array."
"cout << "What is your name?\n";
yourName.inputLine(cin);
cout << "We are " << ourName << endl;
cout << "We will meet again " << yourName << endl;
}"