Protected member functions usage

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rag84dec
    New Member
    • Mar 2007
    • 100

    #1

    Protected member functions usage

    Hi,
    Can anyone please tell me the usage of class member functions declared as protected ??
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Originally posted by rag84dec
    Hi,
    Can anyone please tell me the usage of class member functions declared as protected ??
    A member (either data member or member function) declared in a protected section of a class can only be accessed by member functions and friends of that class, and by member functions and friends of derived classes.

    Regards

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      A protected member is used to remove that mwember from the public interface of the class. Classes with protected members are "incomplete " and rely on derioved classes to complete the implementation. Classes like these are called component, or "mix-in" classes.

      Comment

      Working...