Well, the line "getch();" is going to wait for the user to type a character before exiting the program. Remove it and the program will exit after printing "End of file!" and the console window will close.
mike_2000_17
Posting Virtuoso
2,134 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
If it does print "End of file", then what you need to do to close the window is to click on the X in the upper right corner. Once it reaches the end of the program, if the window doesn't close by then, then there's nothing to put in your program that will close the window.
mike_2000_17
Posting Virtuoso
2,134 posts since Jul 2010
Reputation Points: 1,634
Solved Threads: 457
Perhaps it has something to do with the fact that you're using a freaking ancient compiler with a state of the art OS. Do you have a similar problem with other free compilers that were written for something newer than Windows 3.1?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401