我使用 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/