在c语言里#include<conio.h>是什么样的头文件,包含哪些函数?

最好把里面的主要函数列举一下

#include <conio.h>是一个控制输出的头文件,包含以下函数;textbackground(color)函数【设置文本的背景颜色】;clrscr()函数【清屏】;gotoxy()函数【定位】;getch()函数【输入字符看不见】

例如:

1、char ch;或int ch;

2、getch();或ch=getch();

3、用getch();会等待你按下任意键,再继续执行下面的语句;

4、用ch=getch();会等待你按下任意键之后,把该键字符所对应的ASCII码赋给ch,再执行下面的语句。

扩展资料:

1、头文件是conio.h,而不是stdio.h。

2、getch();并非标准C中的函数,不存在C语言中。所以在使用的时候要注意程序的可移植性。

3、国内C语言新手常常使用getch();来暂停程序且不知道此函数来源,建议使用getchar();(如果情况允许)代替此功能或更换一款编译器。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-01-20
conio.h不是C标准库中的头文件。
conio是Console Input/Output(控制台输入输出)的简写,其中定义了通过控制台进行数据输入和数据输出的函数,主要是一些用户通过按键盘产生的对应操作,比如getch()函数等等。
包含的函数
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);
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);
har *_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);本回答被提问者采纳
第2个回答  2015-09-18
在c语言里#include<conio.h>是调用函数的头文件。

包含的函数有如下这些:
  putch(int);
  ungetch(int);
  void _Cdecl clreol (void);
  void _Cdecl clrscr (void);
  void _Cdecl delline (void);
  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);
  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);
  har *_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个回答  2009-01-19
int _Cdecl getch( void );
int _Cdecl getche( void );
int _Cdecl kbhit( void );
int _Cdecl putch( int __c );
第4个回答  2009-01-19
直接打开那个文件看啦。
相似回答