getchar This is a standard function that gets a character from the stdin. getch This is a nonstandard function that gets a character from keyboard, does not echo to screen. getche This is a nonstandard function that gets a character from the keyboard, echoes to screen.
Use getchar if you want it to work on all compilers. Use getch or getche on a system that supports it when you want keyboard input without pressing [Enter].
And note that the return value of all three is int ! You need this to properly check for EOF.
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
Skill Endorsements: 38
>wat is echo??
In this case, echo means that when you type a character, it prints to the screen so you can see what you typed.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,483
Solved Threads: 1,407
Skill Endorsements: 54
Rocky2008> hope you understood!!
What part of post #2 did you not understand?
Aia
Nearly a Posting Maven
2,394 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 220
Skill Endorsements: 14
wat is echo??
The experience you get from people posting the same, over and over, in this thread.
People! this thread has been answered since post number two. And the only thing it could be added to it might be that unless you have a compelling reason to handicap your code with none standard functions, do not use getche() or getche().
Aia
Nearly a Posting Maven
2,394 posts since Dec 2006
Reputation Points: 2,224
Solved Threads: 220
Skill Endorsements: 14