Hello everyone, this is my first post here so I salute you all!
I am learning C after "The C programming language-second edition" by Dennis Ritchie. There is a piece of cod that doesn't do what it should: counting characters.
Code:
#include <stdio.h>
main ()
{
long nc;
nc = 0;
while (getchar() != EOF)
++nc;
printf("%ld\n", nc);
}
I am using windows7 , devc++ and I am running exe files in cmd. When I run the code above, I can input characters but after hitting Enter I don't get any number( to show how many characters I typed ). I do not have any previous experience with programming languages so please explain at a noob level!
Thank you!