Click here to Skip to main content
15,904,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my output sud b a name(like john smith:age) & his age should change automatically ( 10 times,startin wid 10 ending wid 20),every second/every minute ,& after 10 changes it has to stop,IN V C++ can anybody help me with the code?


eg: john smith: 10(after one second/one minute)
john smith: 11 " "
|
|
|
|
|
|
john smith: 20 (stop)
Posted

1 solution

If you can allow to suspend thread's execution for short time period, then you can use
Sleep(1000) - for 1 sec. See MSDN - Sleep function[^]
But do not do it for large periods, like 1 minute. Here you will need timer. See MSDN - Using Timers[^]
 
Share this answer
 
Comments
Espen Harlinn 22-May-12 8:12am    
5'ed! Fair suggestions :-D

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