<分区>
Possible Duplicate:
How to implement getch() function of C in Linux?
MS-DOS 中 conio.h
头文件的等效 Linux
版本是什么?
有没有办法替换它的功能? 例如获取()
I'm using
gcc
and the text editorGeany
to compileC
code.
标签 c linux gcc header-files
<分区>
Possible Duplicate:
How to implement getch() function of C in Linux?
MS-DOS 中 conio.h
头文件的等效 Linux
版本是什么?
有没有办法替换它的功能? 例如获取()
I'm using
gcc
and the text editorGeany
to compileC
code.
最佳答案
conio.h
是与旧的 MS-DOS 编译器一起使用的 C 头文件,用于创建文本用户界面。针对其他操作系统(例如基于 Linux 的 32 位 Windows 和 OS/2)的编译器通过其他头文件和库提供等效功能。
#include <curses.h>
将为您提供 conio.h
提供的几乎所有功能.
首先需要安装“ncurses”。
如果您使用 Apt 包管理器:
sudo apt-get install libncurses5-dev libncursesw5-dev
如果您使用 rpm
:
sudo yum install ncurses-devel ncurses
对于 getch
,看看"NCURSES Programming HOWTO"文章。
关于c - Linux 上的 <conio.h> 头文件在哪里?为什么找不到 <conio.h>?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48358760/