< conio.h>在哪里? Linux上的头文件?为什么找不到< conio.h> ;?
可能重复:
如何在Linux中实现C的getch()函数?
Possible Duplicate:
How to implement getch() function of C in Linux?
MS-DOS中conio.h
头文件的等效Linux
版本是什么?
What is the equivalent Linux
version of the conio.h
header file from MS-DOS?
是否可以替换其功能? 例如getch()
Is there a way to replace its functionality? e.g. getch()
我正在使用
gcc
和文本编辑器Geany
来编译C
代码.
I'm using
gcc
and the text editorGeany
to compile theC
code.
conio.h
是C
头文件,在旧的MS-DOS编译器中用于创建文本用户界面.针对非DOS操作系统(例如Linux,Win32和OS/2)的编译器提供了这些功能的不同实现.
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.
#include <curses.h>
将为您提供conio.h
首先需要安装Nucurses
nucurses need to be installed at the first place
在基于Deb的发行版中使用
In deb based Distros use
sudo apt-get install libncurses5-dev libncursesw5-dev
在基于rpm的发行版中使用
And in rpm based distros use
sudo yum install ncurses-devel ncurses
对于getch()
类功能,您可以尝试此
For getch()
class of functions, you can try this