[导入]C风格字符串与string类型
C风格字符串等价于string 类型字符串字面值
string str1("Hello!"); //ok.
char *str2 = str1; //error.
char *str3 = str2.c_str(); //ok. but not quite.
//注意c_str()返回的数据类型是const char
const char *str4 = str2.c_str(); //ok.
文章来源:http://liyuxia-life.spaces.live.com/Blog/cns!DA1B364675ACF35!232.entry
转载请注明出处: http://www.cnblogs.com/liyuxia713/