So my problem is simple, the data i am initalizing in my constructor is not saving at all.
basically I have pin pointed to this one point. I have a constructor in a class
strSet::strSet(std::string s){
std::vector<std::string> strVector;
strVector.push_back(s);
}
and in my main file i have
else if(command == "s"){
cout << "Declare (to be singleton). Give set element:";
cin >> input >> single_element;
vector_info temp;
temp.name = input;
strSet set(single_element);
set.output();
temp.vector = set;
list.push_back(temp);
}
when my constructor is called and i check the length of my vector the answer is appropriate, but then when i check the length of my vector in output, it resets to 0?
can anyone help me, much appreciated!!!!!!!
EDIT
this is my .h file
class strSet
{
private:
std::vector<std::string> strVector;
// This is initially empty (when constructed)
bool isSorted () const;
public:
strSet (); // Create empty set
strSet (std::string s); // Create singleton set
void nullify (); // Make a set be empty
bool isNull () const;
int SIZE() const;
void output() const;
bool isMember (std::string s) const;
strSet operator + (const strSet& rtSide); // Union
strSet operator * (const strSet& rtSide); // Intersection
strSet operator - (const strSet& rtSide); // Set subtraction
strSet& operator = (const strSet& rtSide); // Assignment
}; // End of strSet class