home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_05 / 9n05022b < prev    next >
Text File  |  1991-03-18  |  349b  |  30 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. #define NUMELEM(a) (sizeof(a)/sizeof(a[0]))
  5.  
  6. char *command[] = {
  7.     "ADD",
  8.     "DELETE",
  9.     "LIST",
  10.     "REPLACE"
  11. };
  12.  
  13. main()
  14. {
  15.     int i;
  16.  
  17.     for (i = 0; i < NUMELEM(command); ++i)
  18.         printf("command[%d]: %s\n", i, command[i]);
  19. }
  20.  
  21.  
  22. output:
  23.  
  24.  
  25. command[0]: ADD
  26. command[1]: DELETE
  27. command[2]: LIST
  28. command[3]: REPLACE
  29.  
  30.