词条 | getdrivername |
释义 | 函数名: getdrivername 功 能: 返回指向包含当前图形驱动程序名字的字符串指针 用 法: char *getdrivename(void); 程序例: #include #include #include #include int main(void) { /* request auto detection */ int gdriver = DETECT, gmode, errorcode; /* stores the device driver name */ char *drivername; /* initialize graphics and local variables */ initgraph(&gdriver, &gmode, ""); /* read result of initialization */ errorcode = graphresult(); /* an error occurred */ if (errorcode != grOk) { printf("Graphics error: %s\", grapherrormsg(errorcode)); printf("Press any key to halt:"); getch(); /* terminate with an error code */ exit(1); } setcolor(getmaxcolor()); /* get name of the device driver in use */ drivername = getdrivername(); /* for centering text on the screen */ settextjustify(CENTER_TEXT, CENTER_TEXT); /* output the name of the driver */ outtextxy(getmaxx() / 2, getmaxy() / 2, drivername); /* clean up */ getch(); closegraph(); return 0; } |
随便看 |
百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。