将C++的std::string类型变量赋值给char类型数组

    技术2023-05-29  65

    char buf[2048]; std::string s; strcpy(buf,s.c_str())

    关于c_str函数的用法,参照 (https://blog.csdn.net/qq_33375598/article/details/88045851)

    Processed: 0.010, SQL: 9