• Have Any Question?
  • contact@eitworld.com

Closegraph() Function





  • closegraph() function is used to re-enter in the text mode and exit from the graphics mode. If you want to use both text mode and graphics mode in the program then you have to use both initgraph() and closegraph() function in the program.
  • initgraph() function is used to enter in the graphics mode and closegraph() function is used to exit from the graphics mode and also enter in the text mode . Text mode is a default mode.
  • This function deallocates all memory allocated by graphics system and restores the screen to that mode in which it was presented before you called the initgraph() function.
void closegraph();

Program

#include<stdio.h>

#include<conio.h>

#include<graphics.h>

void main()

{

int gd=DETECT,gm;

initgraph(&gd,&gm,” “);

outtext(“Enter any key to come outside from the graphics mode”);

getch();

closegraph();

}

Above program tells that closegraph() function is used to exit from the graphics mode and re-enter in the text mode.

Output

When you will execute the above program you will get the following output screen: closegraph and now you can enter a character to exit from the program…



Real Time Web Analytics