I just started to learn C with the book "The C Programming Language." I am only in the first chapter and am already experiencing problems
There is an section on Character Input and Output. The first example is a "Character Counting" program. The script is a s follows:
Code:
#include <stdio.h>
/*count chars in input, 1st version*/
main ()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
What am I supposed to get when I run the program? So far all I can do it type and the text will show, nothing else.
P.S. Just to let you know I am using Slackware Linux, maybe that has something to do with it...