为什么我只按一个字母键(例如,a
)会出现两次迭代?
#include<stdio.h>
void main()
{
char c;
do
{
c = getch();
printf("Your input: %c\nPress x to exit.\n\n", c);
} while (c != 'x');
}
最佳答案
这是 Windows VS 15.7 _getch
实现中的一个已知错误,已报告 here .
我可以用您的代码重现您的问题,只需按一个键。
关于c - 为什么我只按一次却有两个字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53227473/