Closegraph in C/C++ Graphics


Closegraph in C/C++ Graphics


closegraph() function is used to shut down graphics system.

It deallocates all memory allocated by the graphics system.

It then restores the screen to the mode it was in before you called initgraph().

Syntax :

closegraph();


The graphics system deallocates the memory, such as the drivers, fonts, and internal buffer,
through a call to _graphfreemem.

Example :

void main()
{
int d,m;

d=DETECT;
initgraph(&d,&m,"c:\\tc\\bgi");

line(50,50,500,50);

getch();

closegraph(); // shut down the graphics system.

}

1 comments:

Taneka Grey said...

Input devices play a crucial role in how we interact with technology. It’s similar to using YOLOv8 for real-time object detection enhancing how devices understand and react to input!

Post a Comment