I am using global declaration of map<string,string>
type.
- If i execute the code, is the strings are created in dynamic memory?
- Is the map is created on the dynamic memory or static memory?
-
#include <iostream>
#include <map>
#include <string>
std::map<std::string, std::string> mymap;
class myObject
{
public:
myObject()
{
mymap["A"] = "AString";
mymap["B"] = "BString";
mymap["C"] = "CString";
}
};
int main()
{
myObject obj1;
std::cout << mymap["B"] << std::endl;
return 1;
}