#include<iostream.h>
#include<fstream.h>
int main()
{
ofstream os;
fstream is;
os.open("MrZhangCopy.jpg",ios::out|ios::trunc|ios::binary);
if(!os)
{
cout<<"can't open output file!"<<endl;
}
is.open("E:\\山海工作实\\1.jpg",ios::in|ios::binary);
if(!is)
{
cout<<"can't open input file"<<endl;
}
char ch=NULL;
while(!is.eof())
{
is.read(&ch,1);
os.write(&ch,1);
}
return 0;
}