title: setting const strings equal in method c++?
body: <p>I'm having trouble with the <code>removeItem</code> method because an error occurs right after it's called.
  In this method I'm trying to set the array member with the <code>sku</code> in the argument to <code>nullptr</code> and "remove" it.
  I think it has something to do with the equalization: <code>if(sku == shoppingList[i]-&gt;getSKU())</code>. Or maybe something to do with <code>const</code>. The array has pointers to objects of type <code>Product</code>.</p>
  
  <p>This belongs to CustomerOrder.cpp</p>
  
  <pre><code>CustomerOrder::CustomerOrder()
  : shoppingList()
  {
  
  }
  void CustomerOrder::removeItem(const string &amp;sku)
  {
      for(int i =0; i&lt; 20; i++)
      {
          if(sku == shoppingList[i]-&gt;getSKU())
          {
              shoppingList[i] = nullptr;
          }
      }
  }
  </code></pre>
  
  <p>This belongs in Product.h</p>
  
  <pre><code>private:
  std::string sku;
  </code></pre>
  
  <p>this belongs to Product.cpp</p>
  
  <pre><code>const string &amp; Product::getSKU() const
  {
      return sku;
  }
  </code></pre>