public inheritance

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bob@coolgroups.com

    #1

    public inheritance

    let's say you do public inheritance on a class.

    then you do public inheritance on the subclass.

    in the grandchild, is a protected member in the original class still
    accessible?

  • Victor Bazarov

    #2
    Re: public inheritance

    bob@coolgroups. com wrote:[color=blue]
    > let's say you do public inheritance on a class.
    >
    > then you do public inheritance on the subclass.
    >
    > in the grandchild, is a protected member in the original class still
    > accessible?[/color]

    Yes. Is this homework? You should seriously consider doing your own
    homework, you know. What book are you reading that doesn't explain
    access specifiers [for inheritance]?

    V
    --
    Please remove capital As from my address when replying by mail


    Comment

    • Phlip

      #3
      Re: public inheritance

      bob wrote:
      [color=blue]
      > then you do public inheritance on the subclass.
      >
      > in the grandchild, is a protected member in the original class still
      > accessible?[/color]

      A protected member is accessible anywhere you could write this-> and get the
      member (except where the member's storage class or kind already prevents
      this->, in which case it's accessible anywhere you could have written this->
      on it if that weren't prevented).

      Got all that? ;-)

      --
      Phlip
      http://www.greencheese.org/ZeekLand <-- NOT a blog!!!


      Comment

      Working...