Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uunet!mcsun!ukc!edcastle!lfcs!sam From: sam@lfcs.ed.ac.uk (S. Manoharan) Newsgroups: comp.lang.c++ Subject: Private base class Message-ID: <1533@castle.ed.ac.uk> Date: 10 Jan 90 12:05:54 GMT Reply-To: sam@lfcs.ed.ac.uk (S. Manoharan) Organization: Edinburgh University Computer Services Lines: 37 Yet another What's-wrong-with-my-code question: 1 class base { 2 public: 3 int a; 4 void f() {} 5 }; 6 7 class derived: base { 8 public: 9 base::a; 10 base::f; 11 }; 12 13 14 void main() 15 { 16 derived x; 17 18 x.a = 0; 19 x.f(); 20 } Compiling this with CC (cfront version 1.2.1) gives the following errors: CC test.c: "test.c", line 18: error: a is from private base class "test.c", line 19: error: f is from private base class 2 errors BS says "It is possible to declare some, not all, of the public members of a base class public memberes of a derived class." (page 196) Where have I gone wrong then? Could someone help me? Thanks in advance.