conio.h is a header file used in old MS-DOS compilers to create text user interfaces. It is not part of the C programming language, the C standard library, ISO C nor is it required by POSIX.
This header declares several useful library functions for performing "console input and output" from a program. Most C compilers that target DOS, Windows 3.x, Phar Lap, DOSX, OS/2, or Win32[1] have this header and supply the concomitant library functions in the default C library. Most C compilers that target UNIX and Linux do not have this header and do not supply the concomitant library functions. Some embedded systems are using conio-compatible library [2].
The library functions declared by conio.h vary significantly from compiler to compiler. As originally implemented in Microsoft's Visual C++ the various functions mapped directly to the first few DOS int 21h functions. But the library supplied with Turbo C++ and Borland C++ did not use the DOS API but instead accessed video RAM directly for output and used BIOS interrupt calls.
Compilers that targeted non-DOS operating systems, such as Linux, Win32 and OS/2, provided different implementations of these functions.[citation needed]
Contents |
Member functions
int kbhit(void) |
Determines if a keyboard key was pressed. |
int ungetch(int c) |
Puts the character c back into the keyboard buffer. |
int getch(void) |
Reads a character directly from the console without buffer, and without echo. |
int getche(void) |
Reads a character directly from the console without buffer, but with echo. |
int _cprintf(const char *format, arg0,... argn) |
Formats and prints a string directly to the console. |
int _cputs(const char *string) |
Outputs a string directly to the console. |
int _cscanf(char *format, arg0,... argn) |
Reads and formats values directly from the console. |
See also
References
External links
- Digital Mars's documentation
- IO FAQ - explanation and suggestions for non-standard console IO
- Borland-style CONIO implementation for MinGW/Dev-C++
- List of ways to get raw keyboard input
This entry is from Wikipedia, the leading user-contributed encyclopedia. It may not have been reviewed by professional editors (see full disclaimer)




