Conio. H (console input/output console input and output)

Source: Internet
Author: User

Conio. hNoHeader files in the C standard library.

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.
Included functions: cgets (char *); cprintf (const char *,...); cputs (const char *); cscanf (const char *,...); indium (unsigned short); inpw (unsigned short); getch (void); getche (void); kbhit (void); outp (unsigned short, INT); outpw (unsigned short, unsigned short); putch (INT); ungetch (INT); void _ cdecl clreol (void); void _ cdecl clrscr (void); void _ cdecl delline (void ); int _ cdecl gettext (INT left, int top, int right, int bottom, void * DESTIN); void _ cdecl gettextinfo (struct text_info * R ); void _ cdecl gotoxy (int x, int y); void _ cdecl highvideo (void); void _ cdecl insline (void); void _ cdecl lowvideo (void ); int _ cdecl movetext (INT left, int top, int right, int bottom, int destleft, int desttop); void _ cdecl normvideo (void); int _ cdecl puttext (INT left, int top, int right, int bottom, void * Source); void _ cdecl textattr (INT newattr); void _ cdecl textbackground (INT newcolor ); void _ cdecl textcolor (INT newcolor); void _ cdecl textmode (INT newmode); int _ cdecl wherex (void); int _ cdecl wherey (void ); void _ cdecl window (INT left, int top, int right, int bottom); char * _ cdecl cgets (char * Str ); int _ cdecl cprintf (const char * format ,...); int _ cdecl cputs (const char * Str); int _ cdecl cscanf (const char * format ,...); int _ cdecl getch (void); int _ cdecl getche (void); char * _ cdecl getpass (const char * prompt); int _ cdecl kbhit (void ); int _ cdecl putch (int c); int _ cdecl ungetch (INT ch); edit the usage of this section. The conio library is not only applicable to Windows platforms, but can also be used in Linux. if a compatibility package already exists on the Internet, you can use it after downloading it. for Mac, there is no difference between windows and windows. You can use it directly.
 
 
Demo:
 
# Include "stdafx. H "int main (INT argc, char * argv []) {/* function name: kbhit () (_ kbhit () () in VC ++ 6.0 and return values: check whether there is any keyboard input. If yes, a non-0 value is returned; otherwise, the return value is 0. Usage: int kbhit (void); header file: Include <conio. h> * // * cprintf ("press any key to continue. \ n "); int I = 0; while (! (I = kbhit () {cprintf ("\ n no key pressed. ");} printf (" \ nkbhit () Return: % d. ", I); getch (); * // system (" pause "); // press one key to exit. printf ("press any to continue... \ n "); char CH = getch (); printf (" You pressed % C. \ n done \ n ", CH); // get environment variablechar * chpath = getenv (" pathext "); printf (" % s \ n ", chpath ); int I = getchar (); printf ("% C", I); */return 0 ;}

 
 
 
 

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.