+ 1
I made a function in dervied ninjA class void h() ..why i can access it my (*e1).h();...*e1 is point er of base class
3 Respostas
+ 2
If the base class doesn't know about a function, you shouldn't be able to access it from a base class pointer either, unless for example you perform a cast on the pointer. Perhaps you can post a code sample demonstrating your question for clarification?
+ 2
"Error: 'class Enemy' has no member named 'h', meaning you can't access the method from the base pointer as I said, so what is your question?