C:fgets
STDIN and PIPE
표준입력(STDIN)과 PIPE로 전달되는 입력을 동시에 호환시켜야 할 경우 fgets
를 사용하면 된다.
The point is: When you press CTRL+D
, you signal EOF
on stdin of the parent. So the parent leaves this loop
since fgets()
returns NULL
on EOF
.
표준입력(STDIN)과 PIPE로 전달되는 입력을 동시에 호환시켜야 할 경우 fgets
를 사용하면 된다.
The point is: When you press CTRL+D
, you signal EOF
on stdin of the parent. So the parent leaves this loop
since fgets()
returns NULL
on EOF
.