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

📄 11_27.cpp

📁 10个比较经典的C++程序。初学者就先多学习学习别人吧。
💻 CPP
字号:
#include <iostream>
#include <fstream>
using namespace std;
void main()
{	char ch;
	fstream file;	file.open("zrf.dat",ios::out|ios::in|ios::binary);
	if  (!file)	{	cout << "can not open zrf.dat"<< endl; abort(); }
	for(int i=1;i<3;i++)
	{	file<<i;
		//输出文件指针位置
		cout  << "During inputing, the input position is:"<<file.tellp()<<endl;
	}
	file.seekg(0,ios::beg);		//定位到文件头
	while  (!file.eof())
	{	file.get(ch);
		//输出文件指针位置
		cout  << "During outputing, the output position is:" << file.tellg()<<endl;
	}
}

⌨️ 快捷键说明

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