loading effect
Jan 24, 2009 at 12:42pm UTC
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)
Jan 24, 2009 at 1:11pm UTC
you mean when u are loading a file or what ?
Last edited on Jan 24, 2009 at 1:16pm UTC
Jan 24, 2009 at 3:04pm UTC
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 ;
}
}
Jan 25, 2009 at 1:03am UTC
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.
Jan 25, 2009 at 6:54am UTC
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.
Jan 26, 2009 at 6:45am UTC
haha! thanks you guys! haha! by the way, i'm a girl... well, thanks again! great help!!! ^-^
Jan 26, 2009 at 10:57am UTC
Hah sorry about that - either way hope what I gave you helped. If not - just post again :)
Topic archived. No new replies allowed.