title: No known conversion for argument 1 from ‘std::vector<std::basic_string<char> >*’ to ‘const std::vector<std::basic_string<char> >&’
body: <p>Here's my relevant portion of the .hpp file:</p>
  
  <pre><code>ifndef CUSTOMER_HPP
  #define CUSTOMER_HPP
  
  #include &lt;vector&gt;
  #include "Product.hpp"
  
  class Customer
  {
  private:
    std::vector&lt;std::string&gt; cart;
    //other random member variables
  </code></pre>
  
  <p>Here's my relevant portion of the .cpp file:</p>
  
  <pre><code>#include "Customer.hpp"
  #include "Product.hpp"
  #include &lt;iostream&gt;
  using namespace std;
  
  Customer::Customer(string n, string a, bool pm){
      cart = new vector&lt;string&gt;;
      //other random member variables
  }
  </code></pre>
  
  <p>The full error is:</p>
  
  <pre><code>Customer.cpp:10:7: note: candidate is:
  In file included from /usr/include/c++/4.8/vector:69:0,
               from Customer.hpp:4,
               from Customer.cpp:1:
  /usr/include/c++/4.8/bits/vector.tcc:160:5: note: std::vector&lt;_Tp, _Alloc&gt;&amp; std::vector&lt;_Tp, _Alloc&gt;::operator=(const std::vector&lt;_Tp, _Alloc&gt;&amp;) [with _Tp = std::basic_string&lt;char&gt;; _Alloc = std::allocator&lt;std::basic_string&lt;char&gt; &gt;]
   vector&lt;_Tp, _Alloc&gt;::
   ^
  /usr/include/c++/4.8/bits/vector.tcc:160:5: note:   no known conversion for argument 1 from ‘std::vector&lt;std::basic_string&lt;char&gt; &gt;*’ to ‘const std::vector&lt;std::basic_string&lt;char&gt; &gt;&amp;’
  </code></pre>
  
  <p>If I remove the line 
      cart = new vector;
  I get a segmentation fault when I try to perform:</p>
  
  <pre><code>cart.push_back(random_string);
  </code></pre>
  
  <p>I suspect because it hasn't been initialized. So I added in the above line, and now have the above error.</p>
  
  <p>cart.push_back(random_string) is called in:</p>
  
  <pre><code>void Customer::addProductToCart(string st){
     cout &lt;&lt; "adding " &lt;&lt; st &lt;&lt; " to cart." &lt;&lt; endl;
     getCart().push_back(st);
   }
  </code></pre>
  
  <p>The argument that's passed into cart.push_back() is from</p>
  
  <pre><code>void Store::addProductToMemberCart(string pID, string mID){
      cout &lt;&lt; "HIT in addProductToMemberCarti. pID = " &lt;&lt; pID &lt;&lt; ", mID = " &lt;&lt; mID  &lt;&lt; endl;   
      getMemberFromID(mID)-&gt;addProductToCart(pID);                                                                          }
  </code></pre>
  
  <p>And the getMemberFromID() function that's called there is:</p>
  
  <pre><code> Customer* Store::getMemberFromID(string id){                                                                                
  
      for(int i = 0; i &lt; members.size(); i++){                                                                          
         if(members.at(i)-&gt;getAccountID() == id){                                                                  
             return members.at(i);                                                                                           
           }                                                                                                                  
      }                                                                                                                       
      return NULL;                                                                                                         
  }    
  </code></pre>