我被K&R的1.5.2问题困扰了.我google了一段时间后发现我必须在输入字符后提供EOF输入.
long nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); return 0;
我尝试将commnad-D和control-D作为EOF输入,但没有任何效果.任何想法如何为mac osx提供EOF?
c kernighan-and-ritchie
c ×1
kernighan-and-ritchie ×1