#include "apue.h"
int main (void)
{
char c;
while( (c = getc(stdin)) != EOF )
if( putc(c,stdout) == EOF)
err_sys("putc error");
if( ferror(stdin) )
err_sys("getc error");
exit(0);
}
int main (void)
{
char c;
while( (c = getc(stdin)) != EOF )
if( putc(c,stdout) == EOF)
err_sys("putc error");
if( ferror(stdin) )
err_sys("getc error");
exit(0);
}
<bldc:/home/tingbinz/apue.2e/include/1>R*_*G:./1_3
hello
hello
eof
eof
^C<bldc:/home/tingbinz/apue.2e/include/1>R*_*G: