home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_11_08 / 1108118b < prev    next >
Text File  |  1993-05-23  |  290b  |  21 lines

  1.  1: class X
  2.  2:     {
  3.  3:     int i;
  4.  4:     static int k;
  5.  5: public:
  6.  6:     enum { MAX = 100 };
  7.  7:     X();
  8.  8:     void reset() { k = MAX; }
  9.  9:     };
  10. 10: 
  11. 11: const int MIN = 0;
  12. 12: 
  13. 13: void X::X() : i(MAX)
  14. 14:     {
  15. 15:     if (--k <= MIN)
  16. 16:         reset();
  17. 17:     }
  18. 18: 
  19. 19: int X::k = MAX;
  20.  
  21.