473,396 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

public inheritance

bob
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?

Apr 1 '06 #1
2 2177
bo*@coolgroups.com wrote:
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?


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
Apr 1 '06 #2
bob wrote:
then you do public inheritance on the subclass.

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


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!!!
Apr 1 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ET2 Ng | last post by:
Hi all, If I recall correctly, the functions inherited from a base class are private in the derived class. I want to expose some of them (but not all of them) directly through my derived...
5
by: Andrew Ward | last post by:
Hi All, Sorry if this is off topic, but I could not seem to find a suitable OO Design newsgroup. If there is one feel free to let me know. Here is a simplification of a general design problem I...
19
by: qazmlp | last post by:
class base { // other members public: virtual ~base() { } virtual void virtualMethod1()=0 ; virtual void virtualMethod2()=0 ; virtual void virtualMethod3()=0 ;
9
by: Banaticus Bart | last post by:
I wrote an abstract base class from which I've derived a few other classes. I'd like to create a base class array where each element is an instance of a derived object. I can create a base class...
10
by: Zap | last post by:
Widespread opinion is that public data members are evil, because if you have to change the way the data is stored in your class you have to break the code accessing it, etc. After reading this...
2
by: Tony Johansson | last post by:
Hello experts! My question is what advantage and disadvantage have public inheritance. The answer that I have to this is that sometimes it is an advantage to let a client have access to...
5
by: D Witherspoon | last post by:
What is happening is that I have a class (ClassA) that inherits a class (ClassB) which inherits System.Net.Mail.MailMessage Project 1 references Project 2, Project 2 references Project 3. ...
6
by: Jordi | last post by:
I was wondering, in C++ the syntax for inheritance is basically this: class Descendant : public Parent { .... }; Can someone tell me what would happen when I would replace 'public' by...
9
by: Rudy | last post by:
Hello All! I'm a little confused on Public Class or Modules. Say I have a this on form "A" Public Sub Subtract() Dim Invoice As Decimal Dim Wage As Decimal Static PO As Decimal Invoice =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.