access subclass functions
Saaa
empty at needmail.com
Thu Nov 20 06:53:15 PST 2008
>
>
> from the list (private, protected, public) pick public.
> Note the difference between peel and peal.
:)
>
>
> public YellowBanana: Banana
> {
> void doStuff()
> {
> bool e = peel(); //visible from derived
> //class when defined protected or public.
> }
> }
>
> Banana a = new Banana();
> bool f = a.peel(); //visible only when public
>
> All non-static non-private non-template member functions are virtual.
> (Rule only valid in D)
What does this mean: to be virtual?
>
> If you want to peel your fruit your fruit needs a peel member function,
> or else you need to cast it (dynamic_cast). You can make an abstract
> virtual function (pure virtual function).
I can? :D
>
> What kind of a programme are you making? Just curious.
A game, containing loads of fruits.
More information about the Digitalmars-d-learn
mailing list