Hi all!
I have some biginner question:
I've started to learn C from the Kernighan&Ritchie book, using Pelles C compiler. Why this code (from the book) dont work:
#include <stdio.h>
/* count characters in input; 1st version */
main()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
It should count chars from the input and then print the result (I hope). But when I compile it and start the script all I can do is write some input but it doesnt print anything...
Hope somebody can help me.
Thanks
Bosko