几个小时前,我问了一个关于这段代码的理论方面的问题。现在我明白了一切,但是,该代码根本没有输出。这是http://ideone.com/LWMC5上代码的链接
代码:
#include <stdio.h>
#include <unistd.h> /* changed from "syscalls.h" it was not working */
/* changed the name intentionally */
int main(void)
{
static char buf[BUFSIZ];
static char *bufp = buf;
static int n = 0;
if (n == 0) { /* buffer is empty */
n = read(0, buf, sizeof buf);
bufp = buf;
}
return (--n >= 0) ? (unsigned char) *bufp++ : EOF;
}
我应该做什么/添加来产生输出?