what should be the difference between these getch(), getchar() and getche. if possible give me an example
Welcome to TSDN.
Did you go through a test for these three functions?
Ok.
Let me explain.
getch() : It reads a character and never wait for Enter key.Just gets processed after getting any key pressed.And it never echoes the character on screen which u pressed.
getche() : it works same as
getch() but it echoes on screen.
getchar() : It works differently from others two. Whenever you are pressing any key then the these are kept in Buffer. After hitting enter the first character gets processed. And it obviously echoes on the screen.
I think you got my point.
And if you still not went through it then go through it and see the magic.
Best of Luck.
Kind regards,
Dmjpro.