首頁  >  文章  >  conio.h是什麼頭文件

conio.h是什麼頭文件

藏色散人
藏色散人原創
2020-12-24 16:10:4638587瀏覽

conio.h是控制台輸入輸出函數頭文件,其中con是控制台Console英文縮寫,io是Input/Output輸入輸出,它不屬於C語言標準庫;它還定義了通過控制台進行資料輸入和資料輸出的函數,如鍵盤輸入、螢幕輸出。

conio.h是什麼頭文件

本文操作環境:Windows7系統,Dell G3電腦。

"conio.h"頭檔是 控制台輸入輸出函數頭檔。 con 是控制台Console英文縮寫,io是 Input/Output 輸入輸出。它不屬於C語言標準函式庫。

它定義了透過控制台進行資料輸入和資料輸出的函數,例如 鍵盤輸入,螢幕輸出。它是早期C語言用的輸入輸出函數庫。除了個別函數以外,現在基本上不用(而用標準函式庫 stdio.h)。

可能用的函數是getch(); 和kbhit(void);

getch(); 用於瞬時讀取按下的鍵,(不等待回車換行鍵的到來)。

kbhit(void); 用於瞬時檢查 是否有按鍵動作。其它函數很少用到。

包含的函數

cgets(char*);;
cputs(constchar*);
cscanf(constchar*,...);
inpw(unsignedshort);
getch(void);
getche(void);
kbhit(void);
outp(unsignedshort,int);
outpw(unsignedshort,unsignedshort);
putch(int);
ungetch(int);
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的os X中提供的Xcode卻並不支援這一函數庫。

推薦:《程式設計影片

以上是conio.h是什麼頭文件的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn