I'm reading the book and I followed the small program in the book, there is a small counting program in which I can't have results.
#include <stdio.h>
int main() {
long nc;
nc = 0;
while(getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
When I run this and type in some characters, there is no result, and the program is still executing, I can type in characters but still no result. Are there anything wrong in the code?
And I'm running it in Xcode.