title: Private Vector not being seen in class
body: <p>I am having an issue where a private vector declaration in my class &quot;car&quot; is not being recognized in it's own implementation file.  The other two private variables &quot;model&quot; and &quot;cost&quot; seem to be interpreted correctly by the compiler.  What am I doing wrong here?</p>
  <p>The code below is still in progress so it is not complete.</p>
  <p>Here is the compiler message:</p>
  <pre><code>.\car.cc: In member function 'void car::addPart(option)':
  .\car.cc:18:2: error: 'parts' was not declared in this scope
     18 |  parts.push_back(input);
        |  ^~~~~
  .\car.cc: In member function 'void car::displayInformation()':
  .\car.cc:34:37: error: 'parts' was not declared in this scope
     34 |  for (vector&lt;option&gt;::iterator it = parts.begin(); it != parts.end(); ++it) {
        |                                     ^~~~~
  </code></pre>
  <p>Header File:</p>
  <pre><code>#ifndef CAR_H
  #define CAR_H
  
  #include &quot;library.h&quot;
  
  class car {
  
  public:
  
      ///Default constructor
      car() {
          model = 'N';
          cost = 0;
      }
  
      /**
      * setmodel - a mutator for the car model
      * @param input - the character the model will be set to.  Expects 'E', 'L', or 'X'
      */
      void setModel(char input) { model = input; }
      /** getModel - an accessor for the car model
      *  @return - the car model
      */
      char getModel() { return model; }
  
      /**
      * setCost - a mutator for the car cost
      * @param value - the cost the car will be set to
      */
      void setCost(double value) { cost = value; }
      /** getCost - an accessor for the car cost
      *  @return - the car cost
      */
      double getCost() { return cost; }
  
      /**
      *  Function:   calculateCost
      *              reads through the parts list and adds up the current cost of the car
      */
      void calculateCost();
  
      /**
      *  Function:   addPart
      *              add the option passed in to the part list
       *
      *  @param input - the option to be added
      */
      void addPart(option input);
  
      /**
      *  Function:   removePart
      *              Remove the part with the index passed in from the list.  This will shuffle the later
      *              indexed parts to the left in index.
      *
      *  @param index - the endex of the part to be removed
      */
      void removePart(int index);
  
      /**
       *  Function:   restart
       *              Resets all of the information about the car.  This function is called when the user
       *              wants to start over with their choices.
       */
      void restart();
  
      /**
       *  Function:   displayInformation
       *              Outputs the car information to the user
       */
      void displayInformation();
  
  private:
  
      vector&lt;option&gt; parts;   ///This will store the list of parts (options) the user has selected for the car
      char model;             ///This will store the model of the car
      double cost;            ///This will store the current cost of the car
  
  };
  
  #endif
  </code></pre>
  <p>Implementation:</p>
  <pre><code>#include &quot;library.h&quot;
  
  using namespace std;
  
  void car::calculateCost() {
  
  }
  
  void car::addPart(option input) {
  
      parts.push_back(input);
  
  }
  
  void car::removePart(int index) {
  
  }
  
  void car::restart() {
  
  }
  
  void car::displayInformation() {
  
      cout &lt;&lt; &quot;Model: &quot; &lt;&lt; model &lt;&lt; &quot;, $&quot; &lt;&lt; cost &lt;&lt; &quot;, Options: &quot;;
  
      for (vector&lt;option&gt;::iterator it = parts.begin(); it != parts.end(); ++it) {
  
          cout &lt;&lt; *it.getName();
  
          vector&lt;option&gt;::iterator comma_test = it;
          ++comma_test;
          if (comma_test != parts.end()) {
              cout &lt;&lt; &quot;, &quot;;
          }
  
      }
  
  }
  </code></pre>
  <p>Library Header:</p>
  <pre><code>#ifndef LIBRARY_H
  #define LIBRARY_H
  
  #include &lt;iostream&gt;
  #include &lt;iomanip&gt;
  #include &lt;cstdlib&gt;
  #include &lt;vector&gt;
  #include &lt;fstream&gt;
  #include &lt;string&gt;
  #include &quot;option.h&quot;
  #include &quot;car.h&quot;
  
  #endif
  </code></pre>