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.
Here is the code
using namespace std;
string *AString = "pointer";
map<string *, bool> AMap; //Declare
AMap[AString] = true; //Insert into map with key AString
cerr << AMap["pointer"]; //Does not work