I was just waondering, if it was possible to do 2 things at once in a console app. Like loop the changing of console colours while still being able to do things within the application. Thanks for your time.
I was just waondering, if it was possible to do 2 things at once in a console app. Like loop the changing of console colours while still being able to do things within the application. Thanks for your time.
you can use threads or timers
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Would you care to give me more of an insight on threads please?
Windows or linux?
It is platform specific - so better ask the question about threads on the platform designated forum
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
I believe there's a simple thread implementation in Boost, too, or Qt, both of which would make your code a lot more portable (than using win32-threads or pthreads)
There is also SDL_thread which works very well i think.
Yes, but you have to use the SDL to get at it, which is probably too annoying unless you're actually using the SDL in the first place.
I suggest you try pthreads, unless you want to use another library like one of those mentioned. It's reasonably portable. Search for some tutorials with Google if you're interested.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.