1 #include<iostream> 2 #include<fstream> 3 #include<string> 4 #include<stdlib.h> 5 #include<vector> 6 using namespace std; 7 int filetovector(fstream& file,vector& vect) 8 { 9 string s; 10 //while(getline(infile,s)) 11 while(file>>s) 12 { 13 vect.push_back(s); 14 } 15 file.close(); 16 if(file.eof()) 17 return 4; 18 if(file.bad()) 19 return 2; 20 if(file.fail()) 21 return 3; 22 } 23 int
C++ 读写磁盘文件流
最新推荐文章于 2024-07-13 12:25:02 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)