gpt4 book ai didi

c - Linux 上的 头文件在哪里?为什么我找不到

转载 作者:IT老高 更新时间:2023-10-28 12:30:45 32 4
gpt4 key购买 nike

Possible Duplicate:
How to implement getch() function of C in Linux?

MS-DOS 中 conio.h 头文件的等效 Linux 版本是什么?

有没有办法替换它的功能? 例如getch()

I'm using gcc and the text editor Geany to compile C code.

最佳答案

conio.h是一个 C 头文件,与旧的 MS-DOS 编译器一起用于创建文本用户界面。针对其他操作系统(例如基于 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/8792317/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com