//文件复制操作.cpp
#include<iostream.h>
#include<fstream.h> //有关文件输入、输出的定义文件
#include<stdlib.h>
void main()
{
char ch;
fstream inf,outf;
inf.open("d://temp//filein.txt",ios::in);
if(!inf){
cout<<"It cannot open the file!"<<endl;
abort();
}
outf.open("d://temp//fileout.txt",ios::out);
if(!outf){
cout<<"It cannot open the file!"<<endl;
abort();
}
while(!inf.eof()&&inf.get(ch)){
//inf.get(ch);//按字符读取文件filein.dat的数据
outf.put(ch);
}// 将数据按字符写入文件fileout.dat中
inf.close();
outf.close();
}