Signal EOF in mac osx terminal
I am stumped by the 1.5.2 question in K&R. I googled for sometime and found out that i have to supply the EOF input after entering the characters. long nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); return 0; I tried both commnad-D and control-D as EOF inputs but nothing worked. Any Idea how to supply the EOF for mac osx? Eric Postpischil By default, OS X (formerly Mac OS X) terminals recognize EOF when Ctrl - D is pressed at the beginning of a line. In detail, the actual operation is that, when Ctrl - D is pressed, all bytes in the terminal’s input buffer are sent to the running