Is it possible to pass an array of objects from a child class to a function in a base class?
When I try this it gives me an error message, i guess the compiler does not recognize the child or something
class People
{
public:
int display(Student *list)//this is where i get the error
{ //is it possible to pass a student array as
//display student info //a parameter for a function in the parent class
}
};
class Student : public People
{
};
int main()
{
Student *list; //here is the array of students
list = new Student[5];//the problem is passing it to the function in the
//People class
}
the error is:
error c2061: syntax error: identifier 'Student'