I am confused about getchar()
\'s role in the following code. I mean I know it\'s helping me see the output window which will only be closed when I press the En
The getchar()
function will simply wait until it receives a character, holding the program up until it does.
A character is sent when you hit the enter key; under a Windows OS, it will send a carriage return (CR) and a line-feed (LF).
See this CodingHorror post for a nicely put explanation.
(...the explanation of the CR+LF part, not the getchar()
blocking part)