Borland C++ reference

kbhit

raw OCR

Checks for currently available keystrokes.

Defined in header <conio.h>

Syntax

#include <conio.h>
int kbhit(void);

Portability

DOSUNIXWindowsANSI CC++ only
■

Remarks

kbhit checks to see if a keystroke is currently available. Any available keystrokes can be retrieved with getch or getche.

Return value

If a keystroke is available, kbhit returns a nonzero value. Otherwise, it returns 0.

See also

Example

*include <conio.h>

int main (void)
cprintf ("Press any key to continue:");
while  (IkbhitO)  /* do nothing V  ;
cprintf ("\r\nA key was pressed...\r\n");
return 0;

Differences from modern implementations

Nothing recorded yet.

Modern references

These are search links, not yet checked by hand.