home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_07 / 8n07115a < prev    next >
Text File  |  1990-06-19  |  386b  |  18 lines

  1. /* Listing 1 - Sample of Inheritance */
  2.  #define S1_CLASS int x; \
  3.                   int y; \
  4.                   int (*read_x)(); \
  5.                   int (*read_y)();
  6.  
  7.  typedef struct s1 {
  8.     S1_CLASS
  9.  } S1;
  10.  
  11.  #define S2_CLASS  S1_CLASS \
  12.                    int z; \
  13.                    int (*read_z)(); \
  14.                    
  15.  typedef struct s2 {
  16.     S2_CLASS  
  17.  } S2;
  18.