c++ - Access Bug...
-
Jan Knepper
(46/46)
Jul 15 2004
#include
#include <stdio.h> class X { public : virtual void Print (); }; class Y : public X { private : typedef X super; public : void Print (); }; class Z : public Y { //private : // typedef Y super; public : void Print (); }; void X :: Print () { putchar ( 'X' ); } void Y :: Print () { super :: Print (); putchar ( 'Y' ); } void Z :: Print () { super :: Print (); // 'super' is 'Y :: super' and should be INACCESIBLE!!! putchar ( 'Z' ); } int main ( int, char **, char ** ) { Z z; z.Print (); return ( 0 ); } -- ManiaC++ Jan Knepper But as for me and my household, we shall use Mozilla... www.mozilla.org
Jul 15 2004