conio.h
conio.h是一个C语言的标头档,用于MS-DOS C编译器里。此标头档宣告了数个有用的函式,提供程式设计者主控台的输出入操作接口。大部份MS-DOS、Windows 3.x、Phar Lap、DOSX、OS/2或Win32的C编译器都默认此标头档,并提供相关的函式;但是用于UNIX及Linux的编译器则没有。
基本信息
- 中文名
控制台输入输出
- 外文名
conio.h
- 性质
科学
- 类别
计算机
- 属于
编程
简介
conio.h不是C标准库中的头文件,在Cstandardlibrary,ISOC和POSIX标准中均没有定义。
conio是ConsoleInput/Output(控制台输入输出)的简写,其中定义了通过控制台进行数据输入和数据输出的函数,主要是一些用户通过按键盘产生的对应操作,比如getch()函数等等。
大部分DOS,Windows3.x,PharLap,DOSX,OS/2orWin32平台上的C编译器提供此文件,UNIX和Linux平台的c编译器通常不包含此头文件。
如果需要使用此头文件,可以从互联网下载。
包含的函数
包含的函数:
1 2 3 4 5 6 7 8 9 10 11 | cgets(char*);; cputs(constchar*); cscanf(constchar*,...); inpw(unsignedshort); getch(void); getche(void); kbhit(void); outp(unsignedshort,int); outpw(unsignedshort,unsignedshort); putch(int); ungetch(int); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | void_Cdeclclreol(void); void_Cdeclclrscr(void); void_Cdecldelline(void); int_Cdeclgettext(intleft,inttop,intright,intbottom,void*destin); void_Cdeclgettextinfo(structtext_info*r); void_Cdeclgotoxy(intx,inty); void_Cdeclhighvideo(void); void_Cdeclinsline(void); void_Cdecllowvideo(void); int_Cdeclmovetext(intleft,inttop,intright,intbottom,intdestleft,intdesttop); void_Cdeclnormvideo(void); int_Cdeclputtext(intleft,inttop,intright,intbottom,void*source); void_Cdecltextattr(intnewattr); void_Cdecltextbackground(intnewcolor); void_Cdecltextcolor(intnewcolor); void_Cdecltextmode(intnewmode); int_Cdeclwherex(void); int_Cdeclwherey(void); void_Cdeclwindow(intleft,inttop,intright,intbottom); char*_Cdeclcgets(char*str); int_Cdeclcprintf(constchar*format,...); int_Cdeclcputs(constchar*str); int_Cdeclcscanf(constchar*format,...); int_Cdeclgetch(void); int_Cdeclgetche(void); char*_Cdeclgetpass(constchar*prompt); int_Cdeclkbhit(void); int_Cdeclputch(intc); int_Cdeclungetch(intch); |
用法
conio库不仅适用于 Windows 平台,在 Linux 下也可使用.网上已经有兼容包,下载后打开就可使用;而至于 Mac 则完全跟 Windows 没有区别,直接可以使用。