The illustration shows a code segment with the lines numbered from 25 through 56 and the annotations are as follows:
"strcpy(value, a);
}
//Uses cstring, cstddef, and cstdlib:"
" StringVar::StringVar(const StringVar& stringObject)
: maxLength(stringObject.length( ))” annotated as "Copy constructor (discussed later in this chapter)."
“{
value = new char[maxLength + 1];//+1 is for '\0'.
strcpy(value, stringObject.value);
}
StringVar::~StringVar( )
{"
"delete [] value;" annotated as "Destructor".
“}
//Uses cstring:
int StringVar::length( ) const
{
return strlen(value);
}
//Uses iostream:
void StringVar::inputLine(istream& ins)
{
ins.getline(value, maxLength + 1);
}
//Uses iostream:
ostream& operator <<(ostream& outs, const StringVar& theString)
{
outs << theString.value;
return outs;
}"