码迷,mamicode.com
首页 > 其他好文 > 详细

use include to read a file

时间:2016-09-08 12:50:16      阅读:113      评论:0      收藏:0      [点我收藏+]

标签:

#include<iostream>
#include<fstream>
using namespace std;

void process(string filename)
{
	fstream file(filename);
	file << "Hallo world!" << endl;
	file.close();
}

int main()
{
#include"haha.txt"
	string s = "haha.txt";
	process(s);

	return 0;
}

  

use include to read a file

标签:

原文地址:http://www.cnblogs.com/KennyRom/p/5852408.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!