cleardevice

Overview :

The "cleardevice" function is used to clear the screen in graphics mode.


This function also moves the current position to (0,0).

Syntax :
void cleardevice();
Description :
The "cleardevice" function has no parameters
  • The function can be called in grahics mode.

  • The function dosn't return any value



Example :
#include <graphics.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <conio.h>

 void main()
 {
   
    int gm,gd=DETECT;
	initgraph(&gd,&gm,"C:\\turboc3\\bgi");
    setcolor(10);
	
	outtextxy(100,100,"Press any key to clear the screen");
	
	getch();
	cleardevice();
	
	getch();
    closegraph();
   
 }

Comments

comments powered by Disqus