InterviewSolution
Saved Bookmarks
| 1. |
Explain about getch() function in a C++ program. How it is different from getche() function? |
|
Answer» The GETCH() is a pre-defined LIBRARY function in C++ that is used to receive a single input character from the keyboard, and it holds the SCREEN until it does not receive any character from standard input. This function does not require any arguments and it is defined under the “conio.h” header file. #INCLUDE<iostream.h> #include<conio.h>void main() { cout<<"Enter the character:"<<endl; getch(); }This program holds the output screen until you press any character on the keyboard. The only difference between these TWO functions is getch() does not echo the character to the screen whereas getche() does. |
|