floodfill() function

Declaration of floodfill() function

void floodfill(int x, int y, int border);

floodfill function is used to fill an enclosed area. Current fill pattern and fill color is used tofill the area.(x, y) is any point on the screen if (x,y) lies inside the area then inside will be filled otherwise outside will be filled,border specifies the color of boundary of area. To change fill pattern and fill color use setfillstyle. Code given below draws a circle and then fills it.

C programming code of floodfill()

#include<graphics.h> 
#include<conio.h>
main()
{
	int gd = DETECT, gm;
	initgraph(&gd, &gm, "C:\\ TurboC3\\BGI"); 
	setcolor(RED);
	circle(100,100,50); 
	floodfill(100,100,RED);
	getch(); 
	closegraph(); 
	return 0;
}