I created a pointer to a class I made that points to a dynamic array of pointers of this class. I am trying to use functions from the class I created (Student).
Student **list;
list[i] = TextToClass(tempCourse);
list[i].SetCourse(x);
list[i].SetGrades(inFile);
The assignment works. But using these functions does not work. How exactly do I go about using their functions?
Here is the error:
student.cpp: In member function ‘void Controller::ReadAndStore()’:
student.cpp:119: error: request for member ‘SetCourse’ in ‘((Controller*)this)->Controller::list[i]’, which is of non-class type ‘Student*’
student.cpp:121: error: request for member ‘SetGrades’ in ‘((Controller*)this)->Controller::list[i]’, which is of non-class type ‘Student*’
Have you tried this?