|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<iostream>
#include<fstream>
#include<conio.h>
using namespace std;
int main(int argc,char *argv[])
{
ifstream in;
ofstream out;
if (argc != 3)
{
cout << "输入错误";
exit(1);
}
in.open(argv[1]);
if (!in)
{
cerr << "打开"<<argv[1]<<"失败" << endl;
return 0;
}
out.open(argv[2]);
if (!out)
{
cerr << "打开" << argv[2] << "失败" << endl;
in.close();
return 0;
}
char x;
while (in >> x)
{
cout << x;
out << x;
}
in.close();
out.close();
cout << "复制成功" << endl;
_getch();
return 0;
}
|
|