Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ VC
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 22-May-12 2:50am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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[^]
  Permalink  
Comments
Espen Harlinn at 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)

  Print Answers RSS
0 OriginalGriff 512
1 Maciej Los 445
2 Sergey Alexandrovich Kryukov 421
3 CPallini 200
4 PIEBALDconsult 158
0 Sergey Alexandrovich Kryukov 6,813
1 OriginalGriff 5,342
2 Peter Leow 3,837
3 Mika Wendelius 2,850
4 CHill60 2,748


Advertise | Privacy | Mobile
Web01 | 2.8.150224.1 | Last Updated 22 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100