Q:

getcolor function using graphics.h

0

getcolor function using graphics.h

getcolor function returns the current drawing color.

Declaration : int getcolor();

e.g. a = getcolor(); // a is an integer variable
if current drawing color is WHITE then a will be 15.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT, gm, drawing_color;
   char a[100];

   initgraph(&gd,&gm,"C:\\TC\\BGI");
   
   drawing_color = getcolor();

   sprintf(a,"Current drawing color = %d", drawing_color);
   outtextxy( 10, 10, a );

   getch();
   closegraph();
   return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now