Lab 7 - part 2 - Arrays of objects
back to part 1
Define a class called Text whose objects store lists of words.
The class Text will be just like the class StringVar, except that it
will use a dynamic array with the base type StringVar, rather than base type char;
also, it will mark the end of the array with a blank StringVar object, rather than the char '\0'.
Your class Text will have member functions corresponding to all the member functions of StringVar.
One constructor with an argument const char[] (i.e. a c-string) will initialize the Text object
by creating a separate element of the StringVar array corresponding to each "word"
in the string argument, where "words" are separated by spaces.
The member function input_line will do the same as the above constructor: It will read space-separated
strings and store each string in one element of the StringVar array.
In both cases (constructor and member function), multiple spaces are to be treated as single spaces,
i.e. simply as word separators.
The member function output should output the individual words with a single space between them.
After 5 words, output a newline instead of a space.
back to part 1