|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include <fstream>
#include <iostream>
using namespace std;
int main( int argc, char* argv[])
{
if( argc != 3)
{
return 0;
}
ifstream in;
in.open( argv[1],ios::in | ios::binary);
if( !in )
{
cout << "打开文件失败" << argv[1] << endl;
return 0;
}
char x;
ofstream out;
out.open( argv[2] ,ios::out | ios::binary);
if( !out )
{
cout << "打开文件失败" << endl;
return 0;
in.close();
}
while( !in.eof() )
{
in.get(x);
out.put(x);
}
in.close();
out.close();
return 0;
}
可以复制 但是最后总是多点东西 想不懂什么原因- = 比如文本内容为ABCD 复制完就变成ABCDD 最后多复制一次. |
|