c - 为什么 c 中的 getch() 在我的 mac os x 上不起作用?

标签 c getch

我使用 mac OS X Yosemite。 getchar() 工作正常,但 getch() 不起作用。 它说“函数‘getch’的隐式声明在 C99 中无效。

最佳答案

getch()conio.h 中声明,它不是标准 C 库的一部分。

来自维基百科:

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output. It is not part of the C standard library or ISO C, nor is it defined by POSIX.

关于c - 为什么 c 中的 getch() 在我的 mac os x 上不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31379816/

相关文章:

c - 使用 Yacc 和 Lex 设计一个处理多种类型的计算器

c - Twitter 之类的 "characters left"C 中的函数问题 : How to prevent it from going to the next line?

python - 如何让密码以星号回显

c - Getch() 不读取输入

用于打印文件中的行数和列数的代码。为什么它在 Windows Mingw gcc 环境下工作,但在 Linux 上却不行?

c - 从 ASCII 代码中获取不同的值

c - C 宏上的警告过多

c - 如何包含自定义 C 库

c++ - 使用getch后如何在另一个字符串的末尾连接一个字符串

c - 关于 getch() 输入的查询