home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / oslite11.zip / skip.c < prev    next >
C/C++ Source or Header  |  1994-09-05  |  402b  |  26 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void main (int argc, char **argv)
  5. {
  6.   int c, in;
  7.   if (argc < 2) exit (5);
  8.   c = atoi (argv[1]);
  9.  
  10.   _fsetmode (stdin, "b");
  11.   _fsetmode (stdout, "b");
  12.  
  13.   while (!feof (stdin))
  14.     {
  15.       in = fgetc (stdin);
  16.       if (!feof (stdin))
  17.       { 
  18.       if (!c) fputc (in, stdout);
  19.       else if ((c)&&(in=='\n'))
  20.        { 
  21.        c--;
  22.        }
  23.       }
  24.     }
  25. }
  26.