在遇到大量输入输出的时候,我们知道printf & scanf的效率要大于cin & cout。
但在用到STL的时候,又难免用到string,于是有以下方法。
View Code
1 string test("nothing");
2 printf("%s", test.c_str());
在遇到大量输入输出的时候,我们知道printf & scanf的效率要大于cin & cout。
但在用到STL的时候,又难免用到string,于是有以下方法。
1 string test("nothing");
2 printf("%s", test.c_str());