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

📄 ifstream.cc

📁 资深C++讲师授课代码
💻 CC
字号:
#include <iostream>
#include <fstream>
using namespace std;
#include <string>

int main()
{
	ifstream fin;
	fin.open("data");
	if(!fin.is_open()){
		cout << "open data file error!" << endl;
		return -1;
	}
	string name;
	int age;
	double weight;
	fin >> name >> age >> weight;
	fin.close();
	cout << "name=" << name << endl;
	cout << "age=" << age << endl;
	cout << "weight=" << weight << endl;
}

⌨️ 快捷键说明

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