新手请教(望赐教)
编译器报错为,不能打开包含文件,我郁闷,照书抄的啊,只能请教老手了#include "stdafx.h"
#include<fstream.h>
void main(void)
{
char ch,f1[256],f2[256];
cout<<"请输入源文件名";
cin>>f1;
cout<<"请输入目标文件名";
cin>>f2;
ifstream in(f1,ios::in | ios::nocreate);
ofstream out(f2);
if(!in){cout<<"\n不能打开源文件"<<f1;return;}
if(!out){cout<<"\n不能打开目标文件"<<f2;return;}
in.unsetf(ios::skipwas); //跳过空格
while(in>>ch)
out>>ch;
in.close();
out.close();
cout<<"\n复制完毕!\n";
}