标签:
string s ="abc";
constchar* c_s = s.c_str();
constchar* c_s ="abc";
string s(c_s);
string s ="abc";
char* c;
constint len = s.length();
c =newchar[len+1];
strcpy(c,s.c_str());
char* c ="abc";
string s(c);
constchar* cpc ="abc";
char* pc =newchar[100];//足够长
strcpy(pc,cpc);
C++ char*,const char*,string的相互转换
标签:
原文地址:http://www.cnblogs.com/wxmdevelop/p/4567857.html