Hello I was just doing an exercise in K&R2 and I want the program to count the characters that I type in and display it. However when I type something in the command prompt, it does nothing.
Below is what I have. Thank you very much for taking the time to read a newbie's question.
Code:#include <stdio.h> /* count characters in input; 1st version */ main() { long nc; nc = 0; while (getchar() != EOF) ++nc; printf("%ld\n", nc); }