0

well in a program i m making i need a loading screen it wont be doing anything its just a prank thing im doing
but i need like it to sit and look as if its loading for half a minute
can anyone help
im in the dos box still
on c++

can anyone help me

3
Contributors
7
Replies
9
Views
9 Years
Discussion Span
Last Post by 11silversurfer1
0

well i want it to look like have a percent screen going one to 100 perceant

0

Ok, so add some print statements inside the loop I posted. Use the win32 api function Sleep() to delay the program between print statements. You can't show graphics uniess you want to write a win32 api windows program, but that's not a console program.

0

well i had a program a friend gave me before it was in the dos box but it woul load 1 to 100 percent just the numbers would change

0
int load = 0;
while (load < 100)
load++;
cout << "loading" << load << endl;

this may go fast make another int eg int count = 0; if count = 1000 do the stuff then it will = 0. else count++;

0

well i had a program a friend gave me before it was in the dos box but it woul load 1 to 100 percent just the numbers would change

It's done this way

for(int i = 0; i < 100; i++)
{
   cout << "\r" << i ;
   Sleep(1000); // delay 1 second
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.