Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timing question

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Using this code,


void main()
{ string A,B,C;
A="hello";
B="how are you";
C="what is your name?";

cout<<A<<endl;
cout<<B<<endl;
cout<<C<<endl;
}

its going to display like this,
hello
how are you
what is your name?

My question is,when C++ display those its going to do it fast enough that its going to look like it was display it all at the same time.

How can I get C++ to display one string and wait maybe 2 seconds then display next string and wait 2 second, go on and on ..ect..ect..

Does anyone have any idea?
 
Use Sleep(2000) in between each cout statement. This will give a delay of 2 seconds

raochetan
 
Try Sleep (int) where int represents time in milliseconds.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top