title: Accessing a std::map with pointer type as key
body: <p>I'm trying to use a string as key for an std::map because that string can be changed from different parts of the program but I get a problem that I can store data in the map easily but I can't access it because it is asking for the pointer address as the key and I want to access that data from the string's value.</p>
  
  <p>Here is the code</p>
  
  <pre><code>using namespace std;
  
  string *AString = "pointer";
  
  map&lt;string *, bool&gt; AMap; //Declare
  AMap[AString] = true; //Insert into map with key AString
  
  cerr &lt;&lt; AMap["pointer"]; //Does not work
  </code></pre>