cin.ignore();
cout<<"Enter ID number: ";
getline(cin,ID);
if(searchfile.is_open())
{
while(!searchfile.eof())
{
getline(searchfile, line);
if(ID == line)
{
for (int i = 0; i < 5; i++)
{
cout << line << endl;
getline(searchfile, line);
}
break;
}
}
}
searchfile.close();
}
I have complete search id coding. The problem how can i search for second row which is name.
I have tired use back the same coding but only can display name, ic, gender and dob.