[说明]
下面程序的功能是将多个文件的内容同时输出在屏幕上,文件名都作为参数传入,命令执行为:cat file1 file2 file3,即同时输出file1、file2、file3的内容。
[程序]
#include <stdio.h>
#include <stdlib.h>
void fileeopy(FILE * ifp, FILE *ofp)
int c;
while((c=getc( (1) ))!=EOF) pute(c, (2) );
int main(int arge, char *argv[])
FILE *fp;
while( (3) >0)
if((fp=fopen( (4) ,"r"))= =NULL)
printf("Can’t open file\n");
return 1;
else
filecopy(fp, stdout);
fclose( (5) );
return 0;