上海交通大学交大密西根 联合学院·一 ◆ 181 UM-SJTU Joint Institute University of Michigan Shanghal Jiao Tong University Reading from a file check for successfulness: if (inFile.fail())freturn true;} Read in the input stream. string name; int score; inFile >name > score; Close when you finished:inFile.close ()Reading from a file Reading from a file • check for successfulness: if (inFile.fail()) {return true;} • Read in the input stream. string name; int score; inFile >> name >> score; • Close when you finished: inFile.close ();