I am dealing with code from The C Programming Language, and can't figure out why it's not working. I believe the program is supposed to count how many characters are in a text stream typed, but whenever you type something, it doesn't output anything. I am running Windows XP, using Dev-C++. Here is the code:
Does anyone have any ideas of how to fix my code, or what is going wrong? I have tried all my ideas.Code:#include <stdio.h> main() { long nc; nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); }