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 |
Write a program to print the following series 2 5 11 17 23 31 41 47 59 ...
CAN ANYONE PLEASE HELP ON THIS PROGRAM FOR MY EXAM..TQ Write a C program to help a H’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the H’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the H’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80 Your program must do the following task below: a. Define the data structs, menu item types with two components: menu item of type string and menu price of type double. Use an array to declare the data structs. b. Function get data to loads the data into the array menu list. c. Function show menu to show the different breakfast items offered by the restaurant and tell the user how to select the items. d. Function print receipt to calculates and prints the customer receipt. The billing amount should include a 5% tax. e. Format your output with two decimal places. The name of each item in the output must be left-justify. You may assume that the user selects only one item of a particular type. f. The two sample output as shown: Welcome to HiFi’s Restaurant 1 Bacon and Egg $3.45 1 Muffin $2.20 1 Coffee $1.50 Tax 5% $0.35 Amount Due $7.50
what is the diference between pointer to the function and function to the pointer?
Write a Program to find whether the given number or string is palindrome.
How does variable declaration affect memory?
main() { char p[] = "hello world!"; p = "vector"; printf("%s",p); }
2 Answers Vector, Vector India,
9.how do you write a function that takes a variable number of arguments? What is the prototype of printf () function? 10.How do you access command-line arguments? 11.what does ‘#include<stdio.h>’ mean? 12.what is the difference between #include<> and #include”…”? 13.what are # pragma staments? 14.what is the most appropriate way to write a multi-statement macro?
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)
How macro execution is faster than function ?
how to create duplicate link list using C???
what is constant pointer?
Where is volatile variable stored?