The while condition is the following:
- Code: Select all
while ((var = getchar()) != EOF)
I am pretty positive this is the proper syntax.
The rest of the code is (I think) irrelevant to the loop statement. It is just tasks performed if this while condition is met. It should take all user input until the character return <Enter> key is pressed then perform the functions I have and exit. It does go through the functions to be performed but never exits. It waits for further user input and I eventually have to break (CTRL+C) it to stop the program.
Any ideas?
Edit:
Ok what I have done for now to acheive the result I want is:
- Code: Select all
while ((var = getchar()) != '\n')
Is this the most efficeint way or the only way? It just does not seem right to me.


