#include <stdio.h>
#include <stdlib.h>
int main()
{
int c;
while((c = getc(stdin)) != EOF)
if(putc(c, stdout) == EOF)
{
printf("标准输出出错!\n");
exit(1);
}
if(ferror(stdin))//判断输入流是否发生错误,发生错误返回非0值
{
printf("标准输入出错!\n");
}
return 0;
}
1.3 用标准I/O将标准输入复制到标准输出
最新推荐文章于 2022-04-20 21:33:33 发布