home *** CD-ROM | disk | FTP | other *** search
/ RISCWORLD 7 / RISCWORLD_VOL7.iso / Software / Issue2 / SDL.ARC / !gcc / examples / m / Simple < prev   
Encoding:
Text File  |  2001-01-02  |  301 b   |  30 lines

  1. #include <stdio.h>
  2. #include "simple.h"
  3.  
  4. @implementation simple
  5. {
  6.   int value;
  7. }
  8.  
  9. - init: (int) x
  10. {
  11.   [super init];
  12.   value = x;
  13.   return self;
  14. }
  15.  
  16. - print
  17. {
  18.   printf("%d\n", value);
  19.   return self;
  20. }
  21.  
  22. @end
  23.  
  24. int main(int argc, char **argv)
  25. {
  26.   id t = [[simple alloc] init: 7];
  27.   [t print];
  28.   return 0;
  29. }
  30.