Cleardevice function in C++

Cleardevice() function erases the graphics screen and moves the cursor position to home that is(0,0). Erasing here means filling current background colour. This function takes no arguments.

 

Cleardevice() in C++..

#include<iostream.h>

#include<conio.h>

#include<graphics.h>

class drawC

 {

   private:

     int Xx,Yy,Rr;

   public:

     void getData();

     void Sketch();

  };

void drawC::getData()

 {

    cout<<endl;

    cout<<"Enter the center coordinates(Xx,Yy and radius(Rr) of circule"<<endl;

    cout<<"Xx:";

      cin>>Xx;

   cout<<"Yy:";

      cin>>Yy;

   cout<<"Radius:";

      cin>>Rr;

  }

void drawC::Sketch()

 {

   cout<<"The required circle....pls press enter for clear screen:";

   circle(Xx,Yy,Rr);

 }

void main()

 {

   clrscr();

   int gd=DETECT,gm;

   drawC Cc;

   Cc.getData();

   initgraph(&gd,&gm,"c:\\tc\\bgi");

   Cc.Sketch();

   getch();

   cleardevice();

   cout<<"Clear device() executed";

   getch();

   closegraph();

 }

Output....

Cleardevice() in C++

 

 

About Us

Rekha SetiaRekha Setia is a passionate blogger of Extra Computer Notes. if you have any ideas or any request me @