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.

}

0 comments:

Post a Comment

leftgreen_arrow_animated2 rightgreen_arrow_animated1 home