home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_03 / v7n3079a.txt < prev    next >
Text File  |  1989-01-19  |  990b  |  37 lines

  1.  
  2.         class Newt : public Frog { 
  3.         public:
  4.                 Newt( char *n) : (n) {}
  5.  
  6.                 void jump( int x)
  7.                 {
  8.                         printf( "I'm a jumping Newt\n" );
  9.                         // invoke base class function against 
  10.                         // this derived class object
  11.                         Frog::jump( x);
  12.                 }
  13.         };
  14.  
  15.         class Toad : public Frog { 
  16.         public:
  17.                 Toad( char *n) : (n) {}
  18.  
  19.                 void jump( int x)
  20.                 {
  21.                         printf( "I'm a jumping Toad\n" );
  22.                         Frog::jump( x);
  23.                 }
  24.         };
  25.  
  26.         class Salamander : public Frog { 
  27.         public:
  28.                 Salamander( char *n) : (n) {}
  29.  
  30.                 void jump( int x)
  31.                 {
  32.                         printf( "I'm a jumping Salamander\n" );
  33.                         Frog::jump( x);
  34.                 }
  35.         };
  36.  
  37.