what is the use of getch() function in C program..
difference b/w getch() and getche()??

Answer Posted / lekha

Both getch() and getche() are used to read single character
there is very little difference
-getch() doesn't 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, you'll 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.............

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain that why C is procedural?

660


What are the two forms of #include directive?

644


Explain the concept and use of type void.

630


What are the different types of linkage exist in c?

613


Why is #define used?

790






What is self-referential structure in c programming?

660


Subtract Two Number Without Using Subtraction Operator

357


How can I do graphics in c?

597


What is the scope of global variable in c?

558


How macro execution is faster than function ?

667


What is use of bit field?

774


What does the c preprocessor do?

623


Which header file is essential for using strcmp function?

945


What is storage class?

654


How to implement a packet in C

2398