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

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

问题描述

可能的重复:
Linux如何实现C的getch()函数?

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 C code.

推荐答案

conio.h 是一个 C 头文件,与旧的 MS-DOS 编译器一起使用以创建文本用户界面.针对其他操作系统(例如基于 Linux 的 32 位 Windows 和 OS/2)的编译器通过其他头文件和库提供等效功能.

conio.h is a C header file used with old MS-DOS compilers to create text user interfaces. Compilers that target other operating systems, such as Linux-based, 32-bit Windows and OS/2, provide equivalent functionality through other header files and libraries.

#include 将为您提供 conio.h 提供的几乎所有功能.

The #include <curses.h> will give you almost all of the functionality provided by conio.h.

ncurses"需要首先安装.

"ncurses" needs to be installed in the first place.

如果您使用 Apt 包管理器:

If you use the Apt package manager:

sudo apt-get install libncurses5-dev libncursesw5-dev

如果你使用rpm:

sudo yum install ncurses-devel ncurses

对于 getch,请查看 NCURSES 编程 HOWTO" 文章.

For getch, take a look at the "NCURSES Programming HOWTO" article.

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

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