home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_12 / 9n12116b < prev    next >
Text File  |  1991-10-21  |  491b  |  29 lines

  1. /* LISTING 8 - OBJ.C */
  2. /* implement a 'constructor' to do the
  3.        circle object startup */
  4.  
  5. #include <stdio.h>
  6. #include "obj.h"
  7.  
  8. #define SETCOLOR 0
  9. #define GETCOLOR 1
  10.  
  11. main()
  12.    {
  13.    int col;
  14.  
  15.    /* create a new circle c1 to work with */
  16.    CIRCLE c1;
  17.  
  18.  
  19.    /* call the constructor function for c1 */
  20.    constructor(&c1, 14);
  21.  
  22.    /* use GETCOLOR message to get color */
  23.    col = (*(c1.pcact->pcact[GETCOLOR]))(&c1);
  24.    printf("c1 is color %d\n", col);
  25.    }
  26.  
  27.  
  28.  
  29.