I have a Class Personnel and a sub-class Student
how could i change a pointer pointing to Personnel and have it point to Student?
I'm trying this
Personnel *person=NULL;
PersonnelNode *node=NULL;
PersonnelNode *temp, *prev;
Student *s=new Student();
while (temp != NULL) {
person = temp->getNode();
if (stricmp(name,name)==0){
prev = temp;
temp = temp->getNext();
index++;
}
else{
cout <<"Person to delete is found at index" << index<<endl;
display_node(person, index);
s=person;
s->bookQueue->enqueue(title, due);
}
}
but it says as an error
error C2440: '=' : cannot convert from 'Personnel *' to 'Student *'