//File: records2.cpp #include #include using namespace std; int main() { struct student_record //defines a new type { string name; //three data fields int age; double gpa; }; //NOTE: You need the semicolon here! student_record student; //defines a variable of student_record type ifstream fin ("students_in.txt"); ofstream fout ("students_out.txt"); //The new part while (fin.peek() != EOF) { while (fin.peek() != '\n') { fin >> student.name >> student.age >> student.gpa; fout << student.name << '\t' << student.age << '\t' << student.gpa << endl; } fin.ignore(); } return 0; }