Ok.. this is what I have so far and I'm wondering if everything is right so far?
and I don't know what to pass through the functions.. I'm thinking a pointer pointing at where my array of structures begins.. but what would my pointer be?
Code:
#include <iostream>
#include <fstream>
using namespace std;
void choice1();
void choice2();
void choice3();
void choice4();
int main(int argL, char *argv[1])
{
int studentnumber=0, x=0;
struct My_struct
{
char id[4];
char fname[30];
char lname[30];
char major[10];
float gpa;
};
ifstream infile;
infile.open(argv[1]);
infile >> studentnumber;
My_struct* my_array = new My_struct[studentnumber];
while(x != 5)
{
cout << "Enter a number from the list to choose an option";
cout << "1. List the students sorted by last name";
cout << "2. List the students sorted by student id";
cout << "3. Search the students by last name";
cout << "4. Search the students by student id";
cout << "5. Quit the program";
if (x==1)
choice1();
else if (x==2)
choice2();
else if (x==3)
choice3();
else if (x==4)
choice4();
}
exit(1);
}
void choice1()
{
}
void choice2()
{
}
void choice3()
{
}
void choice4()
{
}