Structs & Functions

Any pointers for this program?

Here is the assignment:
http://www2.cs.uh.edu/~acl/cs1410/Assignment/prog8.pdf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#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;
    }      
}
sorry, no assignments are done here. If you're having any difficulty in some part, specify it and people will help you here. But first try yourself. Gud Luck!
Topic archived. No new replies allowed.