-
getdrivername
鎖定
getdrivername函數名,意為返回指向包含當前圖形驅動程序名字的字符串指針。
- 外文名
- getdrivername
- 功 能
- 返回指向包含當前圖形驅動程序名字的字符串指針
- 用 法
- char *getdrivename
getdrivername函數名
getdrivername
getdrivername功 能
返回指向包含當前圖形驅動程序名字的字符串指針
getdrivername用 法
char *getdrivename(void);
getdrivername程序例
#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\n",
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;
}
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:9次歷史版本
- 最近更新: 炼狱镇魂虾