home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / aix / 9187 < prev    next >
Encoding:
Text File  |  1992-08-29  |  912 b   |  43 lines

  1. Path: sparky!uunet!walter!att!ucbvax!RS1.THCH.UNI-BONN.DE!greve
  2. From: greve@RS1.THCH.UNI-BONN.DE (Thomas Greve)
  3. Newsgroups: comp.unix.aix
  4. Subject: weird C++ inheritance problem
  5. Message-ID: <9208281906.AA12118@rs1.thch.uni-bonn.de>
  6. Date: 28 Aug 92 18:17:26 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Lines: 32
  9. X-Unparsable-Date: Fri, 28 Aug 92 20:06:52 NFT
  10.  
  11. Hello all,
  12.  
  13. the following code is the essence of a problem, that took me half a
  14. day to find out:
  15.  
  16. ---------------------------------------------------------------------------
  17. class A
  18. {
  19.   int B;
  20. };
  21.  
  22. class B : A
  23. {
  24.   int b;
  25.  public:
  26.   B(int i = 0) { b = i; }
  27. };
  28.  
  29. B *x = new B(1);
  30. ---------------------------------------------------------------------------
  31.  
  32. gcc said:
  33. test.cc:13: member `B' is private
  34.  
  35. ;-)
  36.                 - Thomas
  37.  
  38. PS: sorry for asking the n+1st time: where do i send wishes for
  39.     clearer gcc error msg's?
  40.  
  41.    greve@rs1.thch.uni-bonn.de
  42.    unt145@dbnrhrz1
  43.