Closegraph Function - Computer Graphics CG Program

closegraph deallocates all the allocated memory of the graphics system. It then restores the screen to the mode it was in before you called initgraph. (The graphic system released the memory, such as pilots, sources and an internal buffer, through a call to _graphfreemem.)

Statement: void closegraph();
#include<graphics.h>
#include<conio.h>

main()
{
   int gd = DETECT, gm;

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

   outtext("Press any key to close the graphics mode.");

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

Also Read:
Write a program to draw a line in computer graphics in c++

Post a Comment

0 Comments