class A { // wie vorher }; class B : public A { public: int b1; B() { b1 = b2 = b3 = 0; } f(B&); protected: int b2; private: int b3; }; B::f(B& o) { o.b1 = 1; o.b2 = 2; o.b3 = 3; o.a1 = 1; o.a2 = 2; o.a3 = 3; } main() { B d1, d2; d2.f(d1); } //inh6.cc: In method `int B::f(class B &)': //inh6.cc:27: member `a3' is private
© 1997 Gottfried Rudorfer, C++-AG, Lehrveranstaltungen, Abteilung für Angewandte Informatik, Wirtschaftsuniversität Wien, 12/16/1998 |