While loop runs until you press the enter key, ASCII equivalent of enter key is 13.
Whenever you press a key in the keyboard it is stored in the variable ch, which is not echoed on the screen, because the function getch() won't display on the screen.
But we have putch('*') which will put * on the scree, for each key you are pressing.
Finally outside the while loop, you add the null character to end the string.
Regards
Pradeep
It is not how much we do,
but how much love we put in the doing.
-Mother Theresa
|