I am taking Comp 1200 (introduction to C programming for engineers) my freshman year here at AU. I have the old book called "The C Programming Language" by Kernighan and Ritchie. I have come across a code example that doesn't seem to work right. Here it is:
#include <stdio.h>
/*count the characters in input*/
main()
{
double nc;
for (nc = 0; getchar() != EOF; ++nc)
;
printf("#%.0f\n", nc);
}
I thought that this program was supposed to tell me how many characters I input, but it doesn't seem to do anything. Am I missing something here?