home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
cujmay93.zip
/
1105098A
< prev
next >
Wrap
Text File
|
1993-03-09
|
468b
|
25 lines
/* copy2.c */
#include <stdio.h>
#include <stdlib.h>
main(int argc, char *argv[])
{
char s[BUFSIZ];
/* Open optional input file */
if (argc > 1)
if (freopen(argv[1],"r",stdin) == NULL)
return EXIT_FAILURE;
/* Open optional output file */
if (argc > 2)
if (freopen(argv[2],"w",stdout) == NULL)
return EXIT_FAILURE;
while (gets(s))
puts(s);
return EXIT_SUCCESS;
}