home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!walter!att!ucbvax!RS1.THCH.UNI-BONN.DE!greve
- From: greve@RS1.THCH.UNI-BONN.DE (Thomas Greve)
- Newsgroups: comp.unix.aix
- Subject: weird C++ inheritance problem
- Message-ID: <9208281906.AA12118@rs1.thch.uni-bonn.de>
- Date: 28 Aug 92 18:17:26 GMT
- Sender: daemon@ucbvax.BERKELEY.EDU
- Lines: 32
- X-Unparsable-Date: Fri, 28 Aug 92 20:06:52 NFT
-
- Hello all,
-
- the following code is the essence of a problem, that took me half a
- day to find out:
-
- ---------------------------------------------------------------------------
- class A
- {
- int B;
- };
-
- class B : A
- {
- int b;
- public:
- B(int i = 0) { b = i; }
- };
-
- B *x = new B(1);
- ---------------------------------------------------------------------------
-
- gcc said:
- test.cc:13: member `B' is private
-
- ;-)
- - Thomas
-
- PS: sorry for asking the n+1st time: where do i send wishes for
- clearer gcc error msg's?
-
- greve@rs1.thch.uni-bonn.de
- unt145@dbnrhrz1
-