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

📄 04_03.cpp

📁 一些C++的课件和实验源代码
💻 CPP
字号:
// 04_03.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <fstream>
using namespace std;

int main(int argc, char* argv[])
{
	ifstream in("srcfile.txt");
	ofstream out("destfile.txt");

	if(!in){
		cout << "cannot open file 'srcfile.txt'." << endl;
		return 0;
	}
	if(!out){
		cout << "cannot open file 'destfile.txt'." << endl;
		return 0;
	}

	char str[256];
	while(!in.eof()){
		in >> str;
		out << str;
	}
//	char ch;
//	while(in.get(ch))
//		out.put(ch);

	out.close();
	in.close();

	cout << "copy file finished! press any key to exit..." << endl;
	getch();
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -