cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Text colour and Sleep
Text colour and Sleep
Nov 7, 2016 at 4:28pm UTC
Anne693
(24)
How to make the system sleep for sometime (like seconds)?
Also, how to change the text colour in c++?
I saw a program written a long time ago and it uses dos.h but it isn't usable in windows.
I am using codelite for writing c++ programs.
Nov 7, 2016 at 5:08pm UTC
Thomas1965
(4571)
How to make the system sleep for sometime (like seconds)?
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686298(v=vs.85).aspx
Also, how to change the text colour in c++?
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686047(v=vs.85).aspx
Nov 7, 2016 at 5:31pm UTC
mbozzi
(3927)
You should almost always prefer the standard APIs over platform APIs if possible. You can put the current thread to sleep using
std::this_thread::sleep_for()
.
http://www.cplusplus.com/reference/thread/this_thread/sleep_for/
Topic archived. No new replies allowed.