title: find wchar_t data in std::map and duplicates
body: <p>I create a map with as  <code>map&lt; wchar_t , Point3d&gt;</code> StationCoordinates.<br>
  I want to avoid the duplicate data in may map , so i check the key map by function ExistStation ,
  but i does not work correctly.<br>
  here is my code.
  what is the problem in function ExistStation?</p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  struct Point3D
  {
      double x, y, z;
  };
  std::map&lt;const wchar_t *, Point3D&gt;  StationCoordinates;
  
  bool ExistStation(const wchar_t* StationName, Point3D &amp; StationCoord)
  {
      //std::map&lt;wchar_t *, Point3D&gt;::iterator res;
      auto    res = StationCoordinates.find(StationName);
      if (res != StationCoordinates.end())
      {
          StationCoord = res-&gt;second;
          return true;
      }
      return false;
  };
  
  void main()
  {
  
      for (size_t j = 0; j &lt; 4; j++)
          for (size_t i = 0; i &lt; 20; i++)
          {
              wchar_t * mapid = new wchar_t[20];
              //wchar_t  mapid[20];
              swprintf_s((mapid), 20, L"ID%04i", i);
  
              Point3D po;
              if (ExistStation(mapid, po))
                  continue;
  
              po.x = i * 100;
              po.y = i * 1000;
              po.z = i * 1000;
  
              StationCoordinates[mapid] = po;
          }
  
      for (auto k : StationCoordinates)
      {
          wcout &lt;&lt; k.first &lt;&lt; ":" &lt;&lt; k.second.x &lt;&lt; "," &lt;&lt; k.second.y &lt;&lt; "," &lt;&lt; k.second.z &lt;&lt; endl;
      }
  
      wcout &lt;&lt;"The size of the map is:"&lt;&lt; StationCoordinates.size() &lt;&lt; endl;
  }
  </code></pre>
  
  <p>the size of the map must be 20 but it is 80 .</p>