I know kbhit
"Determines if a keyboard key was pressed" but I see that people use both _kbhit
and kbhit
interchangeably.
Asked
Active
Viewed 555 times
0

joshua
- 458
- 5
- 18
-
1`conio.h` is pretty obsolete. You should switch to something like `ncurses` – Eugene Sh. Jun 11 '21 at 19:41
-
1See https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/posix-kbhit?view=msvc-160 – General Grievance Jun 11 '21 at 19:43
-
1`conio.h` is very obsolete and the functions are 100% non-portable to anything but windows. The curses library should be used if any type of portability is needed. – David C. Rankin Jun 11 '21 at 20:27
1 Answers
4
According to this page on MSDN - kbhit
is deprecated
The Microsoft-specific function name kbhit is a deprecated alias for the _kbhit function. By default, it generates Compiler warning (level 3) C4996. The name is deprecated because it doesn't follow the Standard C rules for implementation-specific names. However, the function is still supported.
We recommend you use _kbhit instead. Or, you can continue to use this function name, and disable the warning. For more information, see Turn off the warning and POSIX function names.

Emily-TTG
- 531
- 3
- 18