loading effect

how can i make a loading effect in c++?

for example:

loading...// the 3 dots are apearing one-by-one continuesly

[a bar loading here] 1%

can you please help me? i'm a newbie...(T-T)
you mean when u are loading a file or what ?
Last edited on
If you just want an "effect" you could use something like...

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>

void Wait(int waitTime);

int main()
{
	std::cout << "Loading";
	Wait(100000000);
	std::cout << ".";
	Wait(100000000);
	std::cout << ".";
	Wait(100000000);
	std::cout << ".";
}

void Wait(int waitTime)
{
	for(int i = 0; i < waitTime; i++)
	{
		continue;
	}
}
1
2
3
4
5
6
7
void Wait(int waitTime)
{
	for(int i = 0; i < waitTime; i++)
	{
		continue; //<-- LOLWUT?
	}
}

Not only are current CPUs fast enough to end that loop in milliseconds, optimizing compilers are smart enough to recognize empty loops and reduce them to one or two assignments.
Ahah fast typing mate, he said he just wanted an effect... so I gave him a basic effect he'll understand as he said
can you please help me? I'm a newbie...(T-T)
So no point going in depth with something more detailed.
haha! thanks you guys! haha! by the way, i'm a girl... well, thanks again! great help!!! ^-^
Hah sorry about that - either way hope what I gave you helped. If not - just post again :)
Topic archived. No new replies allowed.