conio.hでキーボード入力
Windows 限定で C 標準ライブラリではないもの
#include <stdio.h>
#include <conio.h>
int main(void) {
char input;
while (1) {
input = _getch() // ここでキーボードの入力を検知させる
if (input == 'w') printf("あなたはwを打ってます")
if (input == 'q') break; // 終了
}
return 0;
}
これで Windows のコンソールゲームとかに使えそう

