GeekInterview.com
Series: Subject: Topic:
Question: 204 of 587

What is the difference between getch() and getche()?

Asked by: harsha_yhvr | Member Since Jun-2007 | Asked on: Aug 6th, 2007

View all questions by harsha_yhvr

Showing Answers 1 - 1 of 1 Answers
SRIDHAR YADAV P.V.

Answered On : Dec 24th, 2012

Both getch() and getche() are used to read single character there is very little difference
-getch() doesnt display output to screen if used without lvalue
-getche() display output to screen even if used without lvalue

following example will clear this.....
1.
main()
{
getch();
}
2.
main()
{
getche();
}
after running above programs...............
when you press any key, youll exit from output screen
verify the output by pressing alt+F5
1. will not show anything
2.will show the key you were pressed......
hope you get it.............

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.