< conio.h>在哪里? Linux上的头文件?为什么找不到< conio.h> ;?

< 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 editor Geany to compile the C code.

conio.hC头文件,在旧的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