C++ program to create a loading bar

By | September 26, 2012
C++ program to create a loading bar


#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>

void main()
{
int x=170,i,gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,”c:\tc\bgi”);
settextstyle(DEFAULT_FONT,HORIZ_DIR,2);
outtextxy(170,180,”LOADING,PLEASE WAIT”);

for(i=0;i<300;++i)
{
delay(30);
line(x,200,x,220);
x++;
}
getch();
closegraph();
}


9 thoughts on “C++ program to create a loading bar

  1. Shehzad

    error found
    BGI ERROR : graphics not initialized (use initgraph)
    bro how to remove this error :S

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *