这是正确的吗,工作正常
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
Regards
其他人说的都是真的。但是,在您发布的代码中,您也可以这样说:
ifstream fin( "in.dat", ios::binary | ios::ate );
ofstream fout( "out.dat", ios::binary );
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)