Hello. I have posted here once before, but for those who may not know, my name is Adam and I am a Programming student. I am having issues with understanding why my code isn't working the way I need it to. I have read my text and read through the tutorial on this site, but still feel like I am missing something. I am not looking for the answer, but some help in the right direction.
I need to write a simple program with a class of both person and student, as well as a polymorphic pointer labeled pIndividual. I understand class and inheritance, but I am having trouble with using a pointer in this manner.
Of course the output for student1 isn't showing up. You never ask it to show up (see lines 68-74). pIndividual is also not going to list anything, as it's empty. ;).
Yeah well, you're listing pIndividual's stats and not those of student1, so you shouldn't be surprised.
Instead of creating a new student, you probably should just assign &student1 to the pointer.
Albatross, Athar and filipe, thank you for your help. My code works now. I understand why the pointer wasn't pointing to what I wanted it to and why my syntax was wrong.