Possible Duplicate:
How to implement getch() function of C in Linux?
What is the equivalent Linux
version of the conio.h
header file from MS-DOS?
Is there a way to replace its functionality? e.g. getch()
I'm using
gcc
and the text editorGeany
to compileC
code.
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.
The #include <curses.h>
will give you almost all the functionalities that was provided in conio.h
nucurses need to be installed at the first place
In deb based Distros use
sudo apt-get install libncurses5-dev libncursesw5-dev
And in rpm based distros use
sudo yum install ncurses-devel ncurses
For getch()
class of functions, you can try this