Question answered, thanks to all!
This is because
printf("%s") expects a C-style string, not
To fix it
Use cout as it is much safer than printf, and can handle your own types (if you have overloaded
Or if you want to do it using printf, you can do
A.c_str()to obtain C-style string.
printf("%s", (*it).second.c_str()); //works
So we have the answer, but not the question… What was it ?