📄 proj12_16.cpp
字号:
#include<iostream>
#include<fstream>
#include<sstream>
using namespace std;
void copyFile()
{
ostringstream buffer;
ifstream sorcefile;
ofstream targetfile;
sorcefile.open("myimage.jpg", ios::in|ios::binary);
targetfile.open("myimagebak.jpg",ios::out|ios::binary);
char ch;
if(!sorcefile)
{
cerr << "原文件不存在!" << endl;
exit(-1);
}
while( sorcefile.get(ch))
targetfile.put(ch);
sorcefile.close();
targetfile.close();
}
void main()
{
cout << "拷贝文件!"<< endl ;
copyFile();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -