windows文件操作程序(文件copy)

C++实现文件拷贝
#include<fstream>
#include<iostream>
#include<cstdio>
using namespace std;
void copy(const char*scrfile,const char*destfile)
{
	ifstream in(scrfile);
	ofstream out(destfile);
	out<<in.rdbuf();
	out.close();
	in.close();
}
void main()
{
	copy("12.txt","13.txt");
}

 

posted @ 2011-12-05 16:08  湾仔小新  阅读(223)  评论(0)    收藏  举报