On the 05 Apr 98, Mike Walker performed the most audacious feat of
simultaneous gibbering and moaning. It was generally directed at All
MW> Something that I am not quite clear on is the difference between
MW> private and protected specifiers within a class. Can someone explain
MW> the difference between these?
protected: means the data can only be modified by a derived class.
MW> Also when would each be used?
Some would say protected: should be used when there are virtual functions
that may have to deal with particular data.
For example, if you designed an abstract base class for a linked-list, you'd
want the head/tail pointers hidden from the user, but you'd also want them
accessible to the virtual functions in a derived class that will be providing
the implementation.
That's not a wholly-realistic example, an abstract base class should not
force a particular implementation by providing data for it, but you get the
idea.
Looks like *another* happy ending!
offworld@bleach.demon.co.uk >##<
... MicroSoft tech support: "Remove all useful utilities from your system."
>> Tag-o-Miga 1.1a - Quoted 31% - 772 tags in Taglines.txt <<
--- Spot 1.3a #1508
---------------
* Origin: None (2:442/107.7)
|