what is getch in c

11 months ago 22
Nature

getch() is a function in C that reads a single character from the console without echoing it to the console. It is a non-standard function and is not defined in the ANSI C standard. It is mostly used by MS-DOS compilers like Turbo C. The function is defined in the header file conio.h . It does not use any buffer to store the input character, and the entered character is immediately returned without waiting for the enter key. The function returns the ASCII value of the key pressed. The function does not accept any parameters. The getch() function is useful in situations where the user must interact with the program.