C++ program to create a loading bar

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();
}

Subscribe To Get Tutorials Directly In You Inbox!

9 comments

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

Reply

There is only one way to fix that error.
Learn OpenGL.

Reply

cannot find iostream.h and graphic.h, microsoft visual studio 2010....

Reply

In function initgraph(&gdriver,&gmode,"c:\\tc\\bgi"); , you have the path for graphic driver <"c:\\tc\\bgi">. Correct the graphic driver.

Reply

Make sure "c:\\tc\\bgi" is pointing to the right directory

Reply

This program generates linker error every time I use it it does no opens

Reply

This program works in turbo c++, which compiler you are using?

Reply

program nt working.....plzz give a solution

Reply

what problem you are getting?

Reply

Post a Comment

Have any Doubt? Ask Here!