Alright, this is for a project that's supposed to read in some code from a file with information on a student. However, it doesn't seem to be reading in anything from the file. I'm working in Visual Studio, and when I run it and pause at the end, I look at the vector I've created and it says there are no students in it. Student is a class I've created.
ifstream input; string student_file; cin >> student_file; input.open(student_file); double id_number = 0; while (input >> id_number) { string name = ""; string address = ""; string phone_number = ""; cin.sync(); getline(input, name); cin.sync(); getline(input, address); cin.sync(); getline(input, phone_number); Student * s = new Student(id_number, name, address, phone_number); students.push_back(s); } The student class should be set up properly with a constructor and everything, so I'm assuming it's this code that's giving me the trouble. Even some direction on whether the problem is with the loop or my use of getlines would be helpful. Thanks!