关于STDIN_FILENO and printf
大家好,我在学习的过程中遇到了一个问题:
代码:
#include "ourhdr.h"
#define BUFFSIZE 8192
int main(void)
{
int n;
char buf[BUFFSIZE];
while ((n = read(STDIN_FILENO, buf, BUFFSIZE)) > 0)
{
if (write(STDOUT_FILENO, buf, n) != n)
err_sys("write error");
printf("the counter of value is %d", n);
}
printf("the counter of value is %d", n);
if (n < 0)
err_sys("read error");
exit(0);
}
让我疑惑的是在我的printf语句没有输入任何东西,
我把while的部分删除掉,他又可以出来的,本来想看看打印printf的返回值
坑爹的我只会printf, 求助很是不解啊!!!!