【发布时间】:2019-04-30 15:00:25
【问题描述】:
我最近安装了 Cygwin64,我正在尝试运行一个 C 程序,它使用 getchar 从键盘获取输入
#include <stdio.h>
// copies input to output
int main()
{
int c;
while ((c = getchar()) != EOF)
putchar(c);
}
我使用 stty -a 检查了哪些键盘信号做了什么,EOF 正确映射到 ctrl+D 但是它什么也没做
I have read that there may be a conflict with MinGW which I am also using
我的解决方案是切换到在 VS Code 中使用 Cygwin 终端,而改用 Windows 键盘信号
【问题讨论】:
标签: c windows cygwin eof getchar