1234567891011121314151617181920212223242526272829303132333435363738394041424344
#include <cstdio> #include <iostream> #include <fstream> #include <iomanip> using namespace std; ifstream inStream; struct student{ string fname; string lname; }; struct roster{ }; bool getRecord(int& recNum, int& id, char fname[], char lname[], char email[], double& gpa); int main(){ } bool getRecord(int& recNum, int& id, char fname[], char lname[], char email[], double& gpa){ if (recNum==0) { inStream.open("prog8in.txt"); if (inStream.fail()){ cout<<"File \"prog8in.txt\" cannot be opened."<<endl; system("pause"); exit(1); } else cout<<"File \"prog8in.txt\" opened."<<endl; } inStream >>id >>fname >>lname >>email >>gpa; if (inStream.eof()) return false; else { recNum++; return true; } }