Click to See Complete Forum and Search --> : best way to learn time based programming for c++?


eon
05-04-2007, 10:55 AM
you know how in basic programs, the program counter goes through each statement, and when it gets to an input, it just waits there
so whats the best way to have it just check for input and move on if nothing is inputed?
i have some experience doing this with premade functions and timers in a embedded systems class with c and vhdl but want to do this with c++ programs

i get a hunch that directx sdk would have libraries for this with the direct input stuff but i would like a more simplified one to fool around with console programs until i learn directx this summer

Remington
05-06-2007, 01:25 AM
There are a bunch of functions in the standard library for processing command line and function parameters.

hu flung dung
05-06-2007, 06:04 PM
Using DirectX seems to be a very round-about approach. Hmm... there are probably better ideas than this, but you could create a multi-threaded application. One thread will be a loop which just waits for input and queues it. The other thread will be your "main" thread. Your main thread would simply check if said queue is empty or not. If it's empty, then there's no input and you can just continue.

I don't know how familiar you are with multithreaded applications though. If you're not at all familiar, it is a somewhat steep learning curve, so maybe the DirectX approach would be easier for you? I don't know.

Or maybe there are functions included in the standard C++ library which allows you to check if input exists before trying to read it in.

eon
05-27-2007, 12:57 AM
ive tried searching for such standard functions and came up empty

do you have anything more specific i should search for?