| 发表于:2007-06-11 00:14:20 楼主 |
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream out( "t.txt "); string line; int i = 0; while(1) { if(out.eof()) break; out > > line ; cout < < line < < " "; }//while(!out.eof()); return 0; } t.txt 内容为hello,world! i hope i can succeed! 输出却为hello,world! i hope i can succeed! succeed!(succeed重复了两次!) 在dev_c++却输出正常。。。 问了几个人,他们的g++都运行正确,为什么? 这问题可以怎么解决呢? 谢谢! |
|
|
|
|