像 getch() 这样的 C 函数在 Mac 上不起作用 — 我可以使用 Windows VM 来运行它们吗?

标签 c windows macos getch

有些 Windows C 函数无法在 Mac 上运行 - 例如getch() 。如果我在 Windows VM 中运行它们,它们会工作吗?或者有没有办法让它们在 OS X 上工作?

最佳答案

使用 getchar();它应该可以工作。

但是如果您确实想使用确切的函数,那么我建议使用 Windows vm 或创建您自己的方法来复制 getch() 并将其用作 mac/linux 上的库。

关于像 getch() 这样的 C 函数在 Mac 上不起作用 — 我可以使用 Windows VM 来运行它们吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39553093/

相关文章:

macos - NSOutlineView 与手动 Cocoa 绑定(bind)

macos - 从 Storyboard、OS X、swift 中的 View Controller 访问菜单项

c++ - 将单个像素值从 RGB 转换为 YUV420 并保存帧 - C++

C 截断 HH :MM:SS from ctime value, ctime

c - 链接库头时对...的 undefined reference

windows - 在批处理脚本中更改暂停命令的输出

c - 在具有两个以太网端口的机器上接收 UDP 广播

windows - 如何在 Windows 上使用 freeglut 制作 Haskell GLUT?

连接 2 个 unicode 字符串 - 如何做到这一点?

xcode - xCode 6.4在El Capitan上崩溃