Difference between and ?

前端 未结 10 1040
囚心锁ツ
囚心锁ツ 2020-11-27 15:52

How come this code

std::map  m;
m[\"a\"]=1;

compiles with (I\'m using MSVC 2010)

#include 

        
10条回答
  •  醉话见心
    2020-11-27 16:15

    As stated, string.h and cstring are C headers (while cstring is basically a C++ wrapper for string.h), containing functions for C strings, which are char[] terminated by '\0'. You want to use the c++ class string, which header is .

提交回复
热议问题