c/c++非阻塞键盘输入监听 Windows/Linux
本文为windows和Linux系统下,对键盘输入进行实时监听的方法,为非阻塞Windows下c代码#include <conio.h>#include <windows.h>#include <iostream>using namespace std;int main(){ while (!_kbhit()) { cout << "Hit me!!" << endl; Sleep(50); } printf("
原创
2020-06-02 11:11:41 ·
5532 阅读 ·
1 评论