I want to read from a file.txt that looks like this:
process_id run_time arrival_time
T1 23 0
T2 75 5
then I will save in arrays
My problem is: the 1st iteration outputs: T 1 2 and that's incorrect
any help please? thanks
while (!ManageFile.eof())
{
ManageFile>>rubbish; //read the word process_id
ManageFile>>rubbish; //read the word run_time
ManageFile>>rubbish; //read the word arrival_time
while (true)
{
ManageFile>>process_id[i];
cout << process_id[i]<<endl;
ManageFile>>run_time[i];
cout << run_time[i]<<endl;
ManageFile>>arrival_time[i];
cout << arrival_time[i]<<endl;
i++;
}