child object array as an argument for base function

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
 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'
probably because the class isn't declared when you are calling it but I could be wrong.
Yea I'm guessing the same thing.
Topic archived. No new replies allowed.