< conio.h>在哪里? Linux上的头文件?为什么找不到< conio.h&gt ;? [英] Where is the <conio.h> header file on Linux? Why can't I find <conio.h>?

查看:199
本文介绍了< conio.h>在哪里? Linux上的头文件?为什么找不到< conio.h&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
如何在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

这篇关于&lt; conio.h&gt;在哪里? Linux上的头文件?为什么找不到&lt; conio.h&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆