Today in this article I am going to demonstrate how to create loading bar in c++ using graphics header file, this tutorial is mainly focused to help the new programmers to understand the graphics methods in c++.

Here is the code that will demonstrate how get a loading bar in c++.

#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();
}
How to create a loading bar in c++

Leave a Reply

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