Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- const int SIZE = 30;
- struct studentType {
- string fName, lName, email;
- int ID;
- double GPA;
- };
- typedef struct studentType S;
- class student {
- private:
- int items;
- public:
- student();
- ~student();
- void addData(string f, string l, double g, int i, string e, S *list[]);
- };
- int main() {
- ifstream fin;
- string f, l, e;
- int i;
- double g;
- student student;
- S sList[SIZE];
- S *list[SIZE];
- fin.open("records.txt");
- if (!fin) {
- cout << "File could not be opened." << endl;
- }
- cout << "Gathering info...";
- while (fin >> f >> l >> g >> i >> e) {
- student.addData(f, l, g, i, e, list);
- }
- cout << "Gathering complete." << endl;
- system("pause");
- return 0;
- }
- student::student() : items(0) {
- S *pList[SIZE];
- }
- student::~student() {}
- void student::addData(string f, string l, double g, int i, string e, S *list[]) {
- /*list[0]->fName = "hello";
- cout << list[0] << endl;*/
- /*list[items]->fName = f;
- list[items]->lName = l;
- list[items]->GPA = g;
- list[items]->ID = i;
- list[items]->email = e;
- items++;*/
- }
- /*Taylor Hicks 2.50 883991892 howhicks@yahoo.com
- Maria Mirzaie 2.98 886653142 tziirii@gmail.com
- Leetal Cohen 3.68 880702399 leetalcohen@gmail.com
- Michael Kouji 3.98 889385022 astromichael@gmail.com
- Danielle Haerblond 2.80 888302743 DaniGeo@aol.com
- Maria Mirzaie 2.68 882323494 tziirii@gmail.com
- Joe Cottoneye 1.42 880381938 longtimag0@gmail.com
- Dale Fields 3.41 881234567 fieldsdl@yahoo.com
- Roy Brooder 2.00 880987654 roeebroods@yahoo.com
- Kailey Yelliac 1.98 886657820 sensorikalie@hotmail.com
- Zach Dontknowwho 2.78 881027840 donahuezachary@yahoo.com*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement