How come this code
std::map <std::string , int> m;
m["a"]=1;
compiles with (I'm using MSVC 2010)
#include <string>
but not with
#include <string.h>
?
<string.h>
contains old functions like strcpy
, strlen
for C style null-terminated strings. <string>
primarily contains the std::string
, std::wstring
and other classes.