i'm so confused with this program. should anyone give me some clues how to begin?

Define a class called StringSet that will be used to store a set of STL strings. Use an array to store strings. Create a constructor that takes as an input parameter an array of strings for the initial values in the set. In this project you should implement the following functions in your class:
StringSet(String []) – Constructor that initializes set with the strings in the array.
AddString(String) – Adds a string to the set
Remove(String) – Removes the requested string from the set
Clear() – Removes all strings from the set
Size() – Returns the number of strings in the set.
Enumerate() – Returns all strings in the set, one line at a time.
Overload the + operator so that it returns the union of two StringSet objects.
Overload the * operator so that it returns the intersection of two StringSet objects.

You should also implement a main() program that tests your class.

8 Years
Discussion Span
Last Post by jonsca

Start out with the class declaration. You have a portion of it already written in this post.

class StringSet
                 //Probably want your array here
                 //Your other functions
}; //this might go in a header file if you want to

Stringset::Stringset(String[] mystring)
       constructor "stuff" goes here

Just take it a step at a time and post back once you have some code.

Edited by jonsca: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.