读书人

fstream连续打开文件的有关问题

发布时间: 2012-04-26 14:01:31 作者: rapoo

fstream连续打开文件的问题

C/C++ code
fstream file;file.open("1.txt");while(!file.eof()){}file.close();file.open("2.txt");while(!file.eof()){}


这样会出现打开第二个文件有错,2.TXT明明有数据,却被判定为没有数据,求教


[解决办法]
http://topic.csdn.net/u/20120421/11/17982952-3518-4264-9e83-1f5d507b106a.html
[解决办法]
不行就先clear

读书人网 >C++

热点推荐