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

📄 8vi.cpp

📁 《C/C++程序设计导论(第二版)》一书的程序源文件
💻 CPP
字号:

// MakeList ()  Make a list of current meds in file "temp.txt"
// ASSUMPTIONS: patfile is opened to the file "patients.txt". outfile is
//	opened to the file "temp.txt". Lowest patID is 1111, highest drug
//	number is 99. Assumes patient is in file. Sentinel is END.
// IN: 	patID is the patient ID number.
// IN/OUT:  patfile is opened to "patients.txt", outfile to "temp.txt"
void MakeList (int patID, ifstream& patfile, ofstream& outfile)
{	int drug, id;
	patfile >> id;
	while (patfile && id != patID)		// find the correct patient
		patfile >> id;
	if (patfile)
	{	patfile >> drug;			// make list of current meds
		while (drug > 0)			// in file using `outfile'
		{	outfile << "  " << drug;
			patfile >> drug;
		}
	}
}

⌨️ 快捷键说明

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