Why does a compilation error occur at conio.h header file?

Library functions like getch(), getche() etc are also used to get input from the user but on submitting the code, the compiler shows error at <conio.h> header file.
Is there any alternative for this case or functions like getch(), getche() can’t be used?

Brother, conio.h is a C header file used in old MS-DOS compilers to create text user interfaces. Compilers that targeted non-DOS operating systems, such as Linux, Win32 and OS/2, provided different implementations of these functions.

For getch() class of functions, you can try this

7 Likes

it is console header file in which some header files like getch(); is used to screen controler…but it is depend on i.d.e different compiler…it is only for giving some comand prompt…in program…if we do’t use these comand so error in compilation is come…

If you are still using Turbo C++ as your compiler, then I’d recommend moving to a more modern compiler such as GCC.