私はすでにいくつかのものをファイルに書き込んでいますが、今は内容を読んで画面に表示したいと思っています。表示する関数を書きましたが、何も表示されません。ビュー関数のコードは次のとおりです。2つの変数のみを表示するようにテストしていました。また、下部で呼び出される表示関数は、親クラスからのもので、他のクラスからのすべての変数を表示します
void ViewAll(string name, Intervention inte)
{
ifstream clientfile(name, ios::in);
if (clientfile)
{
int hour, min, day, month, yr, snum, age;
string fname, lname, interNo, problem, clinic, area, ex, li, type, breed, gender, sname, town, pay;
while (clientfile && !clientfile.eof())
{ //needed to loop through each record in the file
clientfile >> interNo;
clientfile >> clinic;
clientfile >> lname;
clientfile >> fname;
clientfile >> pay;
clientfile >> snum;
clientfile >> sname;
clientfile>> town;
clientfile >> area;
clientfile >> ex;
clientfile >> li;
clientfile >> type;
clientfile >> breed;
clientfile >> gender;
clientfile >> problem;
clientfile >> age;
clientfile >> day;
clientfile >> month;
clientfile >> yr;
clientfile >> hour;
clientfile >> min;
if (fname == inte.getClient().getFname())
{
break;
}
}
//after record is found, create record
inte.getClient();
inte.display();
system("pause");
}
//return inte;
}