title: C++ map not inserting properly
body: <p>I am trying to populate a map from the following structs:</p>
  
  <pre><code>struct CounterParty
  {
      uint8_t firm_id;
      char trader_tag[3];
      uint32_t qty;
  };
  struct OrderFillMessage
  {
      Header header;
      uint32_t order_id;
      uint64_t fill_price;
      uint32_t fill_qty;
      uint8_t no_of_contras;
      std::vector&lt;CounterParty&gt; CounterPartyGroup;
      char termination_string[8]; 
  };
  
  void TradeDecoder::findMostActiveTrader()
  {
      map&lt;char*,int&gt; traders_volume_map;
      for(OrderFillMessage m: OrderFillMessages)
      {
          for(CounterParty cp: m.CounterPartyGroup)
          {
              outputfile&lt;&lt;cp.trader_tag&lt;&lt;" "&lt;&lt;cp.qty&lt;&lt;endl;
              traders_volume_map[cp.trader_tag]+=cp.qty;
          }
      }
      outputFileTrader&lt;&lt;"PRINTING MAP "&lt;&lt;traders_volume_map.size()&lt;&lt;"\n";
      for(auto it=traders_volume_map.begin(); it!=traders_volume_map.end(); it++)
      {
          outputFileTrader&lt;&lt;(it)-&gt;first&lt;&lt;(it)-&gt;second&lt;&lt;endl;
      }
  }
  </code></pre>
  
  <p>As you can see, its just a simple insert or update map function.</p>
  
  <pre><code>outputfile&lt;&lt;cp.trader_tag&lt;&lt;" "&lt;&lt;cp.qty&lt;&lt;endl;
  </code></pre>
  
  <p>prints the following:</p>
  
  <pre><code>IYH 2
  HTC 1
  IYH 2
  HTC 1
  IYH 2
  HTC 1
  IYH 1
  HTC 1
  IYH 1
  HTC 1
  IYH 1
  HTC 1
  IYH 1
  HTC 1
  IYH 1
  </code></pre>
  
  <p>however <code>outputFileTrader&lt;&lt;"PRINTING MAP "&lt;&lt;traders_volume_map.size()&lt;&lt;"\n";</code> prints:</p>
  
  <pre><code>PRINTING MAP 1
  HTC3050
  </code></pre>
  
  <p>Which means that nothing was added to the map, and everything was found even though there is only 1 element in map!?</p>
  
  <p>Any insights as to why this is happening would be greatly appreciated!!</p>
  
  <p>Though I do not think this would cause the map lookup issue, I want to add that <code>trader_tag</code> is a not null terminated <code>char[3]</code>.</p>