阅读背景:

如何在c ++中重用字符串变量

来源:互联网 

Is this correct, it works OK

这是正确的,它运作正常

string str("in.dat");
ifstream fin(str.c_str(), ios::binary | ios::ate );
.
.
.
//Do I need to clear the string before assigning new name???
str = "out.dat";
ofstream fout(str.c_str(), ios::binary); //seems to work
s



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: