Answer the question
In order to leave comments, you need to log in
Bug with std::map or what am I doing wrong?
Greetings,
Please help me, I encountered an incomprehensible behavior of std:: map in MSVC 2010
, for example, I will give the following code:
#include <map>
#include <stdio.h>
#include <Windows.h>
int main()
{
std::map<char*,int> MAP;
MAP["a"] = 42;
char key[10];
scanf("%s",&key);
printf("%s:%d\n",key,MAP[key]);
printf("%d",MAP["a"]);
system("pause");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question