File: mycopy1.c

package info (click to toggle)
genparse 0.9.3-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,456 kB
  • sloc: ansic: 8,766; cpp: 6,059; sh: 5,336; java: 578; yacc: 482; lex: 315; makefile: 302
file content (23 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* mycopy1.c */

#include <stdio.h>
#include <stdlib.h>

int main (int argc, char *argv[])
{
  int c, i, n;
  FILE *fp;

  n = atoi (argv[1]);
  fp = fopen (argv[2],"r");
  
  for (i = 0; i < n; i++)
    {
      while ((c = fgetc (fp)) != EOF)
	fputc (c, stdout);
      rewind (fp);
    }
  
  fclose (fp);
  return 0;
}