what is the difference between getch() and getchar()?

Answer Posted / m@ht@b ahm@d

getchar():- this function returns a character that has been recently typed. the typed character is echoed to the computer screen. after typing the appropriate character the user is required to press enter.

getch():- This function also returns a character that has been recently typed, bet neither the user is required to press enter key after entering the character nor the typed character echoed to the computer screen.

getche():- the advantage of this function over getchar() is that as soon as the user types a character, the character is immediately accepted, i.e. the user is not required to press enter key after typing a character.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

664


What does it mean when a pointer is used in an if statement?

612


What is the significance of c program algorithms?

690


Do pointers take up memory?

672


Explain About fork()?

656






What is merge sort in c?

652


What is calloc()?

637


What is difference between structure and union with example?

605


How do you do dynamic memory allocation in C applications?

636


What is preprocessor with example?

598


What is spark map function?

588


write a c program in such a way that if we enter the today date the output should be next day's date.

1692


Can static variables be declared in a header file?

625


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

652


Why is c fast?

614