複製鏈接
請複製以下鏈接發送給好友

grapherrormsg

鎖定
grapherrormsg,返回一個錯誤信息串的指針
外文名
grapherrormsg
功 能
返回一個錯誤信息串的指針
用 法
char *far grapherrormsg
類    別
函數
門    類
計算機

目錄

grapherrormsg定義

函數名: grapherrormsg
功 能:
用 法: char *far grapherrormsg(int errorcode);

grapherrormsg示例

#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\n", 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;
}