如何用C++语言读取TXT文本文件里的内容(内容是文献信息)?,在学习链表过程中遇到这个问题,暂时没有很好的解决方法
1条回答 默认 最新
- threenewbee 2018-09-22 08:25关注
#include<fstream> #include<iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { ifstream readFile("你的路径\\Test.txt"); char buff[1024]; while (readFile.getline(buff, 1024)) cout << buff << endl; return 0; }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 3无用 2