home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_11_05
/
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;
}