The "bar" function is used to draw a rectangle with the current fill pattern in graphics mode.
void bar(int left, int top, int right, int bottom);
#include <graphics.h> #include <stdio.h> #include <conio.h> int main() { int gm,gd=DETECT,maxcolor; initgraph(&gd,&gm,"C:\\turboc3\\bgi"); setcolor(10); setfillstyle(LINE_FILL,4); bar(100,100,200,200); getch(); closegraph(); return 0; }
![]()