File: mycopy1.c

package info (click to toggle)
genparse 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 3,272 kB
  • ctags: 2,718
  • sloc: ansic: 8,794; cpp: 6,060; sh: 5,175; java: 578; yacc: 482; makefile: 344; lex: 315
file content (23 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (3)
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;
}