[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
protected Partial Access Restriction Modifier
protected access_specifier
A public object member can be used by any function in the
program; a private member can only be accessed by members of that
object or by friend objects. By default, the members of classes are
private, and the members of structs and unions public.
If a member is protected, its access is the same as if it were
private. Note, however, that the member can be used by member
functions and friends of classes derived from the class (but only in
objects of the derived type).
-------------------------------- Example ---------------------------------
class birdwatch {
int num_finches;
int num_seagulls;
protected:
int finch_spotted(void);
int seagull_spotted(void);
};
See Also: private public
Online resources provided by: http://www.ClipX.Net --- NG 2 HTML conversion by Dave Pearson