Include Conio H Dev C++

  1. Conio H C
  2. #include Conio.h In C++

Jul 19, 2017 ‘conio.h' is included in MSDOS compilers but not in gcc/g. Hence, you cannot include conio.h in DevC. But still there are certain substitute which may be considered in place of conio.h. For further information you may refer the following post: CONIO.H alternative for Dev-C IDE Users. But in my opinion you should not use conio.h or it's alternatives. It may create portability problems. The conio.h header file used in C programming language contains functions for console input/output. Some of its most commonly used functions are clrscr, getch, getche, kbhit etc. They can be used to clear screen, change color of text and background, move text, check whether a key is pressed or not and to perform other tasks.

conio.h is a C header file used mostly by MS-DOS compilers to provide console input/output.[1] It is not part of the C standard library or ISO C, nor it is defined 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[2] have this header and supply the associated 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 library functions. Some embedded systems or cc65 use a conio-compatible library.[3]

The library functions declared by conio.h vary somewhat from compiler to compiler. As originally implemented in Lattice C, the various functions mapped directly to the first few DOSINT 21H functions. The library supplied with Borland's Turbo C did not use the DOS API but instead accessed video RAM directly for output and used BIOS interrupt calls. This library also has additional functions inspired from the successful Turbo Pascal one.

Compilers that target non-DOS operating systems, such as Linux or OS/2, provide similar solutions; the unix-related curses library is very common here. Another example is SyncTERM's ciolib. The version of conio.h done by DJ Delorie for the GO32 extender is particularly extensive.[4]

Include conio.h c++

Member functions[edit]

kbhitDetermines if a keyboard key was pressed
cgetsReads a string directly from the console
cscanfReads formatted values directly from the console
putchWrites a character directly to the console
cputsWrites a string directly to the console
cprintfFormats values and writes them directly to the console
clrscrClears the screen
getchGet char entry from the console

References[edit]

  1. ^Schildt, Herbert (1995). C: The Complete Reference (3rd ed.). Berkeley, Calif.: Osborne McGraw-Hill. p. 288. ISBN0-07-882101-0. For DOS-compatible compilers, the direct console I/O functions generally use the CONIO.H header file.
  2. ^'Console and Port I/O in MSDN'.
  3. ^'MicroVGA conio Text User Interface Library'.
  4. ^'DJGPP C Library Reference – conio'.

Conio H C

External links[edit]

  • IO FAQ - explanation and suggestions for non-standard console IO
Include Conio H Dev C++Conio
Retrieved from 'https://en.wikipedia.org/w/index.php?title=Conio.h&oldid=948634838'

#include Conio.h In C++

Nothing platform-specific is particularly convenient, but if you wish to do both Windows and *nix then I recommend you to the NCurses library.
For use on POSIX platforms (like Ubuntu): NCurses
http://www.gnu.org/software/ncurses/
For use on Windows: PDCurses
http://pdcurses.sourceforge.net/
Both are highly compatible and, unless you are doing something the documentation says is specific to one or the other, they should work identically.
Here are some useful links:
Links for getting started: http://www.cplusplus.com/forum/windows/15935/#msg79025
Basics: http://www.cplusplus.com/forum/beginner/5796/#msg25862
Basic example ('Press the 'any' key'): http://www.cplusplus.com/forum/general/497/#msg1734
Informative example: http://www.cplusplus.com/forum/beginner/4520/#msg19965
Basic color example: http://www.cplusplus.com/forum/general/11032/2/#msg52617
Another color example: http://www.cplusplus.com/forum/general/11032/#msg52049
Wikipedia article & links: http://en.wikipedia.org/wiki/Ncurses
'NCURSES programming HOWTO': http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/
Be sure to look around for good documentation too. A good start is to Google for 'man curses'.
Hope this helps.

Comments are closed.