[C Language] conio. H function details

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.