home *** CD-ROM | disk | FTP | other *** search
/ BBS 1 / BBS#1.iso / document / compress.arj / MKHARD.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-09-05  |  459 b   |  32 lines

  1.  
  2. #include    <stdio.h>
  3.  
  4. #define    NP    251    /* must be *prime* number, <= 256 (so 251 is max) */
  5.  
  6. FILE    * outStream;
  7.  
  8. main ()    {
  9.     int        i, j;
  10.     unsigned char    ch;
  11.  
  12.     outStream = fopen ("_hard_", "wb");
  13.     if (outStream == NULL)    {
  14.         printf ("Can't open file\n");
  15.         return    1;
  16.     }
  17.  
  18.     for (i = 1; i < NP; i ++)    {
  19.         ch = 0;
  20.         for (j = 1; j < NP; j ++)    {
  21.             ch += ' ';
  22.             fwrite (&ch, 1, 1, outStream);
  23.             ch -= ' ';
  24.             ch = (ch + i) % NP;
  25.         }
  26.     }
  27.  
  28.     fclose (outStream);
  29.  
  30.     return    0;
  31. }
  32.