Here’s an example of the situation:
CAnimal *poTest = new CDog();
When I write “poTest->” All I can see are functions from the base class (in example: CAnimal) and not the ones in the derived one. How can I access these?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You’ve declared poTest as a CAnimal.
So it makes sense that you’ll only see what a CAnimal can see.
If you want to use methods that a CDog uses, declare it so.