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.

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

class StringSet
{
          private:
                 //Probably want your array here
          public:
                 //Constructor(s)
                 //Your other functions
}; //this might go in a header file if you want to

Then
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 6 Years Ago by jonsca: n/a

This article has been dead for over six months. Start a new discussion instead.