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

📄 chapter2-12.cpp

📁 STL程序员开发指南源码
💻 CPP
字号:
//文件名:CHAPTER2-12.cpp
#include<fstream.h>
#include<iostream.h>
#include<process.h>
void  main()
{
	int  i=30;
	float  f=12.34;
	char  c;
	fstream  fl("sf",ios::out|ios::in);
	if(!fl) {cerr<<"The File Open Error."<<endl; exit(255);}
	fl<<"I="<<i<<"  ;F="<<f<<endl;
	fl.seekp(ios::beg);		//指针回文件首
	fl>>c>>c;			//字符串"I="读出后不使用
	fl>>++i;				//i加1后从盘上读出i仍为30
	cout<<i<<endl;
}

⌨️ 快捷键说明

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