Quote:
How can I know the user just entered ^D?
|
If you're reading from
stdin, I hope you're using function
fgets(); see its man page.
That man page will show you that
fgets() returns
NULL on end of file, and the
^D which triggered the end of file will be absorbed by the function itself; you'll never see it. Just test for that
NULL.