Question: 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

```

Answer: 
```
strSet::strSet(std::string s){
   std::vector<std::string> strVector; //line 1
   strVector.push_back(s);             //line 2
}

```

This is your constructor, and here you're storing the value in the local vector which gets destroyed on returning from the constructor. How do you expect your data to be saved in strSet?

I believe you need to know the basic of C++ and class, by reading an introductory C++ book yourself. So please get a book and read it first; here is a list of really good books:

[The Definitive C++ Book Guide and List](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list)

EDIT:

If you've declared `strVector` as class member, then you need to remove the `line 1`. Then it will work.
You're initializing a stack local variable in your `strSet::strSet` constructor. When you are returning from your constructor, all stack local variables are destroyed.

The way to fix this would be to declare the `strVector` variable as a class member variable.

An example:

```
class strSet {
public:
  strSet(std::string s) {
    this->strVector.push_back(s);
  }

private:
  std::vector<std::string> strVector;
};

```