I am a hardware engineer teaching myself C from the K&R second edition bible to allow me to do some basic low level testing of my hw before handing it over to the sw guys.
I have downloaded MinGW to use on my pc and have added MinGW\bin to my environment variables. i have created a few wee bits of code from chapter 1 that have ran fine from my windows command prompt but am having problems with EOF.
the simple code i am running is:
I get the warning when i compile : no newline at end of file. as i am only putting in characters from the keyboard as oppose to a file, how do i get around this.
while ((c = getchar()) != EOF)
Ex1_6 in the book asks me to verify that EOF = 0 or 1, however, entering this does not exit the program ( i also know that the value for EOF = -1 but entering this value does not exit the program either - is this an ANSCII thing)
Its a simple beginner problem, but one i would like to get to the bottom of none the less.
Any help would be greatly appreciated.
cheers in advance, gems