C++使用printf输出string类

string里有c_str()函数用于string转char数组。

使用方法为

string str;
printf("%s",str.c_str());
原文地址:https://www.cnblogs.com/kalicener/p/13595383.html