home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_07 / 9n07064a < prev    next >
Text File  |  1991-05-07  |  1KB  |  42 lines

  1.  
  2. /***********************************************************
  3. *                                                          *
  4. *  Listing #2                                              *
  5. *                                                          *
  6. *  Non-Simulated 2-D array test case for modified Small    *
  7. *  C V2.0.  From CUG disk #163, and PC Club of Toronto     *
  8. *  #152.  This listing is identical in function to         *
  9. *  listing #1 but uses the extended compiler.              *
  10. *                                                          *
  11. *                                   1/91  - Don Lang       *
  12. ***********************************************************/
  13.  
  14. /*
  15.   Declaration for c.lib
  16.             */
  17. extern int printf();
  18.  
  19. char garray[2][2] = {1, 2, 3, 4};
  20.  
  21. main()
  22. {
  23.     ga_print(2,2, garray);
  24. }
  25. /*
  26.     This global print function will test passing of
  27.     array arguments, and thus the modified Small C
  28.     function "doargs."
  29.                    */
  30. ga_print (a,b, array) int a,b; char array[][2];
  31. {
  32.        int i,k;
  33.        printf("\n");
  34.        i=0;
  35.        while (i < a) {
  36.          for(k=0; k<b; k++) printf(" %d ", array[i][k]);
  37.          printf("\n");
  38.          i++;
  39.        }
  40. }
  41.  
  42.