what is the difference between getch() and getche()?
Answers were Sorted based on User's Feedback
Answer / m.karthiga
the getch() does not echo any characters. but getche()
should echo the characters
Is This Answer Correct ? | 67 Yes | 7 No |
Answer / rama krishna sidhartha
Here are some examples for getch() and getche() to distinguish :
Example for getch() :
main()
{
getch();
}
OUTPUT : black screen(nothing is displayed)
Example for getche() :
main()
{
getche();
}
OUTPUT : u(the cursor waits for sometime untill you press
any key from the keyboard after pressing it immediately goes
to blue screen)
Is This Answer Correct ? | 40 Yes | 10 No |
Answer / azad sable,chiplun.
The 'e' in getche() fuction means it echoes(display) the
character that you typed to the screen.As against it ,getch
()just returns the character that that you typed without
echoing it on the screen.
Is This Answer Correct ? | 25 Yes | 2 No |
Answer / beulah david
Both getch() and getche() are used to read single character
there is very little difference
For Example.....
1.
main()
{
getch();
}
after running the above program
when you press any key, you'll exit from output screen
verify the output by pressing alt+F5
will not show anything
OUTPUT : black screen(nothing is displayed)
2.
main()
{
getche();
}
will show the key you were pressed
OUTPUT : u(the cursor waits for sometime untill you press
any key from the keyboard after pressing it immediately goes
to blue screen)
Is This Answer Correct ? | 15 Yes | 9 No |
Answer / ayaskanta
getch is used to get a character from keyboard. once a key
is pressed it goes back to blue screen. In the case of
getche the compiler waits for you to press ENTER after you
have entered another character through keyboard.
Is This Answer Correct ? | 14 Yes | 9 No |
Answer / umer khan
getch() is a library file to #include <conio.h> which is mostly used in stidios compiler......
while getche() takes input frm the user withtout presing '\r'
Is This Answer Correct ? | 3 Yes | 5 No |
Answer / rambabu
these two are different where the difference is identified
as when we r using getch() for get the echo output it is
black screen and as well as getche() it containsa blue screen
Is This Answer Correct ? | 7 Yes | 15 No |
How does free() know how many bytes to free?
main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }
how to make program without <> in library.
What is the difference b/w Structure & Union?
How can I dynamically allocate arrays?
Expand the following LKB BKL FFG
a c code by using memory allocation for add ,multiply of sprase matrixes
what is difference between array and structure?
44 Answers College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,
How can a program be made to print the name of a source file where an error occurs?
Write a program to generate random numbers in c?
Tell about strtok & strstr functions
2 Answers HCL, iFlex, Motorola,
What does the && operator do in a program code?