use include to read a file

#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;
}

  

posted @ 2016-09-08 11:25  KennyRom  阅读(114)  评论(0编辑  收藏  举报