conio.h
目录
1简介
conio.h不是C标准库中的头文件,在C standard library,ISO C 和
POSIX标准中均没有定义。
conio是Console Input/Output(控制台输入输出)的简写,其中定义了通过控制台进行数据输入和
数据输出的函数,主要是一些用户通过按键盘产生的对应操作,比如getch()函数等等。
如果需要使用此头文件,可以从互联网下载。
2包含的函数
包含的函数:
1
2
3
4
5
6
7
8
9
10
11
12
13
|
cgets(
char
*);
cprintf(
const
char
*, ...);
cputs(
const
char
*);
cscanf(
const
char
*, ...);
inp(unsigned
short
);
inpw(unsigned
short
);
getch(
void
);
getche(
void
);
kbhit(
void
);
outp(unsigned
short
,
int
);
outpw(unsigned
short
, unsigned
short
);
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
_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);
|
3用法
conio库不仅适用于 Windows 平台,在 Linux 下也可使用.网上已经有兼容包,下载后打开就可使用;而至于 Mac 则完全跟 Windows 没有区别,直接可以使用.