我想制作一个永远运行的程序并接受用户输入,例如
while(1)
{
if(currentkeybeingpressed != NULL)
{
print(the current character); /* So that the program just waits until a key is
pressed and outputs the same letter the moment it is touched*/
}
}
我想在KISS控制器上执行此操作,该控制器没有准备好导入的conio.h文件,因此我无法使用getch函数。还有另一种方法可以找出目前正在按下的键吗?
#include<stdio.h>
int main() {
while(1){
putchar(getchar());
}
}
希望这可以帮助。