P
P
PoopCoder2015-09-23 16:44:15
C++ / C#
PoopCoder, 2015-09-23 16:44:15

How to delay output to a stream in c++?

Help me please.
I wrote like this:
cout <<"Loading ...00%";
sleep(3);
cout<<"\b\b\b99%";
And he does not want to break the stream, so he does not display the first message, makes a delay, and then displays a message with 99 instead of 00

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
whiteblackness, 2015-09-23
@PoopCoder

cout - buffered output.
Flush cout.flush
() buffer

J
jackroll, 2015-09-23
@jackroll

sleep(3); // specify time in milliseconds

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question