| C语言库函数(C类字母) |
|
| 作者:未知 文章来源:网络收集 点击数: 更新时间:2006-3-29 15:22:24
|
screen */ outtextxy(midx, midy, "press any key to clear the screen:");
/* wait for a key */ getch();
/* clear the screen */ cleardevice();
/* output another message */ outtextxy(midx, midy, "press any key to quit:");
/* clean up */ getch(); closegraph(); return 0; }
函数名: clearerr 功 能: 复位错误标志 用 法:void clearerr(FILE *stream); 程序例:
#include
int main(void) { FILE *fp; char ch;
/* open a file for writing */ fp = fopen("DUMMY.FIL", "w");
/* force an error condition by attempting to read */ ch = fgetc(fp); printf("%c\n",ch);
if (ferror(fp)) { /* display an error message */ printf("Error reading from DUMMY.FIL\n");
/* reset the error and EOF indicators */ clearerr(fp); }
fclose(fp); return 0; }
函数名: clearviewport 功 能: 清除图形视区 用 法: void far clearviewport(void); 程序例:
#include #include #include #include
#define CLIP_ON 1 /* activates clipping in viewport */
int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; int ht;
/* initialize graphics and local variables */ initgraph(&gdriver, &gmode, "");
/* read result of initialization */ errorcode = graphresult(); if (errorcode != grOk) /* an error occurred */ { printf("Graphics error: %s\n", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ }
setcolor(getmaxcolor()); ht = textheight("W");
/* message in default full-screen viewport */ outtextxy(0, 0, "* <-- (0, 0) in default viewport");
/* create a smaller viewport */ setviewport(50, 50, getmaxx()-50, getmaxy()-50, CLIP_ON);
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页
|
|
[ 收藏此页到: 天天|和讯|博采|ViVi|狐摘|我摘|天极 ] 文章录入:kinda 责任编辑:kinda |
|
上一篇文章: C语言库函数(B类字母) 下一篇文章: C语言库函数(D类字母) |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |