I am using Class templates and Linked lists to read and write to a .txt file. I have the code down to where it will compile but i'm not sure what to do within the Linked list print function but it should call print functions from a class called Student.
Here is the code in the Main file.cpp:
1 2 3 4
void PrintGradeReports(ofstream &outFile, linkedList<Person*> personList, int numStudentsReg, int tuitionRate)
{
personList.Print(outFile, personList,numStudentsReg, tuitionRate);
}
Here is the code for the Template class Print function:
In this code, void PrintGradeReports(ofstream &outFile, linkedList<Person*> personList, int numStudentsReg, int tuitionRate)
why do you use linkedList<Person*> personList instead of linkedList<Person*>& personList ? Is this a typo or do you really want to pass linkedList<Person*> personList by copy constructor?
Also, what are you trying to achieve with this code (can you explain with plain words what is the task you are solving?)