title: Error trying to find const char* key from std::map
body: <p>I have a map declared like this:</p>
  
  <pre><code>std::map&lt;const char*, const char*&gt; map2D;
  </code></pre>
  
  <p>The map is filled by the output from an API function, which returns <code>const char*</code>:  </p>
  
  <pre><code>map2D.insert(std::pair&lt;const char*, const char*&gt;(TempA, TempB));
  </code></pre>
  
  <p>Now there are 50 <code>TempA</code> values and 50 <code>TempB</code> values, and there is one key with the name of "months". When I am searching for this key, I am getting "not found". E.g.:  </p>
  
  <pre><code>std::map&lt;const char*, const char*&gt;::iterator it;
  it = map2D.find("months");
  
  if (it != map2D.end()) 
  {
      std::cout &lt;&lt; "Found " &lt;&lt; it-&gt;first &lt;&lt; " " &lt;&lt; it-&gt;second &lt;&lt; '\n';
  }
  else 
  {
      std::cout &lt;&lt; "Not found\n";
  }  
  </code></pre>
  
  <p>But when I am doing it like this:  </p>
  
  <pre><code>map2D.insert(std::pair&lt;const char*, const char*&gt;("months", "June");  
  </code></pre>
  
  <p>I can find the respective month. After searching the web, I understand that this problem may be related to the use of <code>const char*</code>. Can anyone further clarify this?</p>