home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
cujmay93.zip
/
1105099A
< prev
next >
Wrap
Text File
|
1993-03-09
|
539b
|
30 lines
/* copy3.c */
#include <stdio.h>
#include <stdlib.h>
main(int argc, char *argv[])
{
if (argc == 3)
{
char s[BUFSIZ];
FILE *inf, *outf;
if ((inf = fopen(argv[1],"r")) == NULL)
return EXIT_FAILURE;
if ((outf = fopen(argv[2],"w")) == NULL)
return EXIT_FAILURE;
while (fgets(s,BUFSIZ,inf))
fputs(s,outf);
fclose(inf);
fclose(outf);
return EXIT_SUCCESS;
}
else
return EXIT_FAILURE;
}