Share via


Console and Port I/O

These routines read and write on your console or on the specified port. The console I/O routines are not compatible with stream I/O or low-level I/O library routines. The console or port does not have to be opened or closed before I/O is performed, so there are no open or close routines in this category. In Windows NT and Windows 95, the output from these functions is always directed to the console and cannot be redirected.

Console and Port I/O Routines

Routine Use
_cgets Read string from console
_cprintf Write formatted data to console
_cputs Write string to console
_cscanf Read formatted data from console
_getch Read character from console
_getche Read character from console and echo it
_inp Read one byte from specified I/O port
_inpd Read double word from specified I/O port
_inpw Read 2-byte word from specified I/O port
_kbhit Check for keystroke at console; use before attempting to read from console
_outp Write one byte to specified I/O port
_outpd Write double word to specified I/O port
_outpw Write word to specified I/O port
_putch Write character to console
_ungetch “Unget” last character read from console so it becomes next character read