📄 8vi.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 + -