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

📄 8vii.cpp

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

// FindDrug()  Locate the correct drug record in "drugs.txt"
// ASSUMPTIONS: file "drugs.txt" is opened to `drugfile'.
//	List sentinal is END. newdrug must be found in file.
// IN: newdrug is the drug to be found.
// IN/OUT:  drugfile is opened to "drugs.txt"
void FindDrug (ifstream& drugfile, int newdrug)
{	int thisdrug;
	drugfile >> thisdrug;				// first drug for each record
	while (drugfile && thisdrug != newdrug)
		{ 	drugfile >> thisdrug;		// if wrong drug, skip over list
			while (thisdrug > 0)
				drugfile >> thisdrug;
			drugfile >> thisdrug;		// and get next drug record
		}
}

⌨️ 快捷键说明

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