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

标签 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 editor Geany to compile C 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/

相关文章:

linux - 了解 Tcpdump 过滤器和位掩码

c - gcc:用 `-mavx -mprefer-avx128`优化单个函数

c - HiC : Structure within Structure?

C 错误 : undefined reference to function, 但已定义

linux - 在 grep 匹配模式输出行前面打印文件名

linux - 显示 "buffered view"命令结果时禁用 'git'

gcc - GCC 会被 LLVM 取代吗?

gcc - GNU 标准库命名约定

android - 每次调用 JNI 方法时附加值

c - c编程中如何使用 "extern struct"共享变量并用gcc编译?