I follow the book C programing second edition and try to output this code:
#include <stdio.h>
main()
{
long nc;
nc = 0;
while(getchar() != EOF)
++nc;
printf("%1d\n", nc);
}
and I can't figure out why I don't have any output.
I work on crunchbang++ and to create the output I entered in the terminal:
cc -ansi file.c
then
./a.out
but when I enter characters I have a blank response.
I don't want just the working code, but an explanation, because I really want to learn how it works.