閱讀876 返回首頁    go 技術社區[雲棲]


一次讀取文件中所有內容

https://blog.csdn.net/banzhiyu/archive/2007/07/26/1708438.aspx

一次讀取文件中所有內容 

#include <fstream>
#include <sstream>
#include <string>
#include <iostream>
#include <cstdlib>
using namespace std;

int  main()
{
string str;
ifstream ifile("test.txt");

ostringstream tmp;
tmp<<ifile.rdbuf();  //
str = tmp.str();
cout<<str<<endl;

system("pause");
return 0;
}

最後更新:2017-04-02 06:51:22

  上一篇:go 恢複任務欄顯示桌麵快捷方式
  下一篇:go magento 1.4 -- 推薦插件 -- 穀歌地圖 -- Google Map Locations