getdrivername

getdrivername函式名,意為返回指向包含當前圖形驅動程式名字的字元串指針

基本介紹

  • 外文名:getdrivername
  • 功 能:程式名字的字元串指針
  • 用 法:char *getdrivename
  • 屬於:函式名
函式名,功 能,用 法,程式例,

函式名

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\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;
}

相關詞條

熱門詞條

聯絡我們