getdrivername() function returns the name of the graphics-driver. The graphics-driver is loaded by the initgraph() function. You can learn about the graphics-driver and initgraph() function in detail in chapter Let’s Start.
- getdrivername returns a pointer to a string with the name of the currently loaded graphics driver by the initgraph() function.
- For better understanding go through the program:
int gd=DETECT, gm;
sprintf(a,”The value of the current background color is %s”,getdrivername);
The above program will display the name of graphic driver currently loaded by the initgraph function. getdrivername() function will return the name of graphics driver and store it into the character pointer drivername and at last program will display a message as given in the output: