home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 160_01 / unird.c < prev    next >
C/C++ Source or Header  |  1985-11-26  |  347b  |  20 lines

  1. /* unird - universal read distribution
  2.  */
  3. #include <stdio.h>
  4. main()
  5.     {
  6.     char b[BUFSIZ];
  7.     FILE *fp;
  8.  
  9.     do {
  10.         gets(b);
  11.         } while (strncmp(b, "###", 3) != 0);
  12.     while (strncmp(b, "###EOF", 6) != 0)
  13.         {
  14.         fp = fopen(&b[3], "w");
  15.         while (gets(b) != NULL && strncmp(b, "###", 3) != 0)
  16.             fprintf(fp, "%s\n", b);
  17.         fclose(fp);
  18.         }
  19.     }
  20.