ios::in输入的问题
#include <fstream>#include <string>#include <iostream>using namespace std;void main(){ /* first pass */ string s; fstream f2; f2.open("d:/1.txt",ios::in); if(!f2) return; while(f2>>s) cout<<s<<endl; f2.close(); /* second pass */ f2.open("d:/1.txt",ios::in); if(!f2) return; while(f2>>s) cout<<s<<endl; f2.close();}