0
点赞
收藏
分享

微信扫一扫

C艹中string与cahr *互转

elvinyang 2022-03-10 阅读 30
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 条评论