For reasons of self-improvement / broadening my horizons I have decided to learn some of the fundamentals of C using the K&R 'C Programming Language Book'.
I have been following along with the exercises, using Bloodhsed DEV C++ 4.9.9.2 as my IDE.
I came across the following exercise - counting characters in an input:
main()
{
double nc;
for (nc = 0; getchar() != EOF; ++nc);
printf("&.0f\n", nc);
}
This code complies and runs without error.
However, when I enter a string in the console window and press enter I do not get any output i.e. a number that shows how many characters in the string. For example, if I type 'test' in the console window I am expecting 4 to appear as output.
I am sure the issue is simply the way I have set up my IDE? Or am I missing something more fundamental?
Any help much appreciated. Having come from a VB background I am really excited about learning a different language like C and getting to grips with pointers!
Edit
A related answer to my question is also given here and is very helpful: