如果还需要c_str()这种操作,那说明代码还在用字符串指针,还是用pure C的风格在写代码
另外,sprintf()也是pure C的搞法,C++的搞法是std::format()或者fmt::format(),强调编译期的type-safe检查。
【 在 ylh1969 的大作中提到: 】
: cout << .. << ..
: string << .. << :
: 最后,stmt=string.cstr();
: ...................
--
FROM 111.199.144.*