c - 在 linux 中用 c 代替 getch 和 clrscr()

标签 c linux

我最近在 Ubuntu 上工作。当我使用 gcc 编译我的 C 程序时,出现错误 conio.h doesn't exists。 我想使用 clrscr()getch() 函数。 你能告诉我这个头文件在 linux 中的替代品吗?

最佳答案

getch() 函数可以在 curses.h(库“curses”)中找到。同一个库提供了清除屏幕的功能。查看这些链接:

http://linux.die.net/man/3/getch

http://linux.die.net/man/3/erase

关于c - 在 linux 中用 c 代替 getch 和 clrscr(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11823904/

相关文章:

python - 在 shell 中运行 python 的脚本

c - char 与 char 数组 : Why is there a difference? 的堆栈变量分配

c - 小端字节顺序

c - 从 st_size 读取自己的大小的程序

linux - 在 shell 脚本命令中传递参数

regex - 在 bash 脚本中查找文件夹名称的一部分

linux - 记录执行期间的内存访问

c++ - _mm_packus_epi16 饱和问题

c - C语言中argv函数和字符串作为地址

linux - 带有箭头键和修饰符的 NCurses