⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 proj12_16.cpp

📁 C++程序设计教程的全部源代码 包含与教程同步的PPT 方便学习
💻 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 + -