Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
no seriously, I am a beginner at code. how do I make the result in C++ last for more than 1 second...?

Thanks in advance.
Posted
Comments
future2015 20-Jun-14 2:16am    
what do you mean by last for more than 1 second...?

1.You should use Sleep(10000); ==> wait for 10 seconds

2.Or your could wait until a key is pressed, by using getch();
 
Share this answer
 
v2
Comments
Stefan_Lang 20-Jun-14 2:40am    
You probably mean Sleep(10000), not Sleep (1000) ;-)
Raul Iloc 20-Jun-14 13:44pm    
You right, I missed a zero!
But the idea is to use Sleep method.
Joren Heit 22-Jun-14 11:22am    
Can't you just run your program from the commandline instead of double-clicking the executable? This is how it works on linux...
On Windows use Sleep[^], on Linux, sleep[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900