title: map in header file c++
body: <p>Simple question....</p>
  
  <p>I have a header file called bag...</p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  
  using namespace std;
  
  
  class Bag
  {
  public:
  
  Bag();
  
  
  map &lt;const string str, int number&gt; items;
  
  private:
  
  };
  
  #endif
  </code></pre>
  
  <p>In the implementation, I'd like to insert something into bag:</p>
  
  <pre><code>#include &lt;string&gt;
  #include &lt;fstream&gt;
  #include &lt;map&gt;
  #include "Bag.h"
  
  using namespace std;
  
  Bag::Bag()
  {
  items["brush"] = 4;
  }
  </code></pre>
  
  <p>But for some reason, i can't access items.  What am I doing wrong????</p>
  
  <p>Thanks!</p>