Thread: c++ question
View Single Post
  #4 (permalink)  
Old February 24th, 2004, 02:45 PM
pradeep_itguy pradeep_itguy is offline
Friend of Wrox
 
Join Date: Feb 2004
Posts: 177
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
Reply With Quote