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

  1. /* getcolor "member" function */ 
  2. int circle_getcolor(CIRCLE *pc) { return pc->color; }
  3.  
  4. /* setcolor member function */
  5. int circle_setcolor (CIRCLE *pc, int val); { return (pc->color 
  6. = val); }
  7.  
  8. /* define and initialize the action package */ 
  9. CIRCLE_ACTIONS caction = { circle_getcolor, circle_setcolor 
  10. }; 
  11.  
  12. /* define CIRCLE c and hook it to the action pack */ 
  13. CIRCLE c = { 10, 10, 5, 4, /* set x, y, radius and color 
  14. */
  15. &caction; /* set paction pointer in c to point to the 
  16. action package */ 
  17. }; 
  18.