I\'ve started reading \"The C Programming Language\" (K&R) and I have a doubt about the getchar() function.
getchar()
For example this code:
#
Your first program only reads one character, prints it out, and exits. Your second program has a loop. It keeps reading characters one at a time and printing them out until it reads an EOF character. Only one character is stored at any given time.