home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_09_06 / 9n06018a < prev    next >
Text File  |  1991-02-17  |  337b  |  25 lines

  1.  
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. main()
  6. {
  7.     int rows = 0;
  8.     long (*pl)[10];
  9.  
  10.     while (rows < 1) {
  11.         printf("Enter number of 10 element rows: ");
  12.         scanf("%4d", &rows);
  13.     }
  14.  
  15.     pl = malloc(rows * sizeof(*pl));
  16.     if (pl == NULL) {
  17.         printf("malloc failed\n");
  18.         exit(1);
  19.     }
  20.  
  21.     pl[0][2] = 1234;
  22.     pl[0][9] = 9876;
  23. }
  24.  
  25.