数時間前に、このコードの理論的側面について質問しました。今ではすべてを理解していますが、そのコードは単に出力を提供しません。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;
}
出力を生成するにはどうすればよいですか/追加しますか?