how to clear the key buffer while using kbhit() and getch()
问题 heu so I'm using the above stated windows functions which luckily are for windows 2000 and up, but in making a game on the console I've run into a problem: as soon as a key is pressed the console gets passed the kbhit() function no matter if a key is not pressed again... is there some way I can clear the keyboard press buffer so you can't get passed kbhit without a new keypress? If a new lib download is requires I guess I could... but I'm hoping for a windows standard way! Thanks!! 回答1: