词条 | grapherrormsg |
释义 | 函数名: grapherrormsg 功 能: 返回一个错误信息串的指针 用 法: char *far grapherrormsg(int errorcode); 程序例: #include <graphics.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #define NONSENSE -50 int main(void) { /* FORCE AN ERROR TO OCCUR */ int gdriver = NONSENSE, gmode, errorcode; /* initialize graphics mode */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); /* if an error occurred, then output a */ /* descriptive error message. */ if (errorcode != grOk) { printf("Graphics error: %s\", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); exit(1); /* terminate with an error code */ } /* draw a line */ line(0, 0, getmaxx(), getmaxy()); /* clean up */ getch(); closegraph(); return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。