#include "apue.h"
int main(){
int c;
while((c=getc(stdin))!=EOF)
if(putc(c,stdout)==EOF)
err_sys("output error");
if(ferror(stdin))
err_sys("input error");
exit(0);
}
把标准输入复制到标准输出,没什么好说的#include "apue.h"
int main(){
int c;
while((c=getc(stdin))!=EOF)
if(putc(c,stdout)==EOF)
err_sys("output error");
if(ferror(stdin))
err_sys("input error");
exit(0);
}
把标准输入复制到标准输出,没什么好说的