I. Introduction
Conio is short for console input/output (console input/output). It defines functions for data input and output through the console, mainly for operations generated by users by keyboard, for example, the getch () function.
The C compiler on most dos, Windows 3.x, phar lap, dosx, OS/2 or Win32 platforms provides this file. The C compiler on UNIX and Linux platforms usually does not contain this header file.
2. Install and test in Ubuntu and use conio
[Note] This version of library is searched online. Only to test textcolor. Later, I checked the source code and found that many functions in conio were incomplete. Therefore, if you want to use conio further, you need to Tao another full version of conio.
Conio Installation File libconio-1.0.0
Installation Process: compress the downloaded files to any directory.
CD to libconio-1.0.0
Chmod 755 *
Sh./configure
Make
Make install
After the installation is successful, a static library of libconio. A will be available in usr/lib.
Iii. Test and use
# Include <conio. h> int main () {int I, j; clrscr (); // The Screen clearing function for (I = 0; I <9; I ++) {for (j = 0; j <80; j ++) printf ("C"); printf ("\ r \ n"); textcolor (I + 1 );} return 0 ;}
This program mainly outputs the color font on the console. Pay attention to the use of textcolor.
Gcc-O test. C-l usr/lib-lconio
./Test