Path: utzoo!attcan!uunet!inxsvcs!mwg From: mwg@inxsvcs.UUCP (Phil Blecker) Newsgroups: comp.lang.c++ Subject: Re: accessing base class protected members Message-ID: <116@inxsvcs.UUCP> Date: 11 Feb 89 23:35:25 GMT References: <26619@teknowledge-vaxc.ARPA> Distribution: na Organization: INX Services, Los Angeles, CA Lines: 16 In article <26619@teknowledge-vaxc.ARPA>, mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) questsion: > // test use of "protected" members > > ... error: botint is protected > Is the complaint valid? If so, why? I don't know what the official definition of protected is, but I know how it seems to work. Protected means that only derived classes have access to the members. That doesn't include friends. Friends only have access to the private and public members declared in the class the made them friends. Being a friend doesn't give access to base classes, even when protected is used in the base class. You have to do that explicitly. Makes sense, and it seems to be the way it works. -- Phil Blecker +1 818 243-3053 none of my ideas belong to me and uunet!inxsvcs!mwg i can't see anything wrong with that