comparison os9/mc09/test/cp.c @ 107:c5dd5c363d43

mc.c in intel64 ( LP64 )
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sat, 29 Dec 2018 23:05:40 +0900
parents
children 36000611014b
comparison
equal deleted inserted replaced
106:6566b9f47f4a 107:c5dd5c363d43
1 #include "mclibos9.c"
2
3 int
4 main(argc,argv)
5 int argc;char *argv[]; {
6 FILE *input ;
7 FILE *output ;
8 int c;
9 int i;
10
11 input = STDIN;
12 output = STDOUT;
13
14 i = 1;
15 if (argv[i]) { input = fopen(argv[i++],"r"); }
16 if (argv[i]) { output = fopen(argv[i++],"w"); }
17 while( (c = getc(input) ) != -1) {
18 putc(c,output);
19 }
20 return 1;
21 }