阅读876 返回首页    go 阿里云 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