char pp[10] = "shanrui";
string pps((char*)pp, 10);
cout << pps << endl;
int n = pps.size();
char* stc = new char[n + 1];
memcpy(stc, pps.c_str(), n);
C艹中string与cahr *互转
阅读 30
2022-03-10
char pp[10] = "shanrui";
string pps((char*)pp, 10);
cout << pps << endl;
int n = pps.size();
char* stc = new char[n + 1];
memcpy(stc, pps.c_str(), n);
相关推荐
精彩评论(0)