摘要:
string对象是一种很强大的存在哈~~1. string转const char*string s = "abc";const char* c_s = s.c_str();2. const char*转string直接赋值即可const char* c_s = "abc";string s(c_s);3. string转char*string s = "abc";char* c;const int len = s.length();c = new char[len+1];strcpy(c,s.c_str());4. char*转str 阅读全文