home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / EXTRA-ST / CPM-80-E / CPM-0.2 / CPM-0 / cpm-0.2 / format.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-06-06  |  357 b   |  19 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(int argc, char *argv[]) {
  6.     int kb;
  7.     char buff[1024];
  8.     if (argc != 2) {
  9.     fprintf(stderr, "usage: format (kb)\n");
  10.     exit(1);
  11.     }
  12.     kb = atoi(argv[1]);
  13.     memset(buff, 0xe5, 1024);
  14.     if (kb > 0 && kb <= 1504)
  15.     while (kb--)
  16.         fwrite(buff, 1, 1024, stdout);
  17.     return 0;
  18. }
  19.