Ctrl-D signals the end of file/transmission thus
is sufficient.Code:while ((c = getchar()) != EOF)
This is a discussion on Switch statement does not flow through cases within the C Programming forums, part of the General Programming Boards category; Originally Posted by sjmp need to terminate the program using CNTRL D - ASCII 4? that is what I was ...
I removed c !=4 and it no longer responded to CNTRLD, I am using windows...
Got it working! for real this time
set \t and '' to state OUT
set \n to increment and state out
default if char increment and fixed the word count as another if statement proceeding that.
Thanks for everyone's help. In three months from now, when I am an expert programmer I will remember you all.