passive input?

Sorry, I don't really knowing how to title this thread. for the same reason i dont know what to title it, i dont really dont know what i should be google searching either.

How do I make a program that is constantly running through a loop in the background, but in the foreground in the console I am still able pass a string of text without the loop stopping in order to take my input. That way the loops functionality could update based on that input but would continue to run as normal in the absence of input.

Basically im trying to make a genetic prediction algorythm and it would be nice to make it so that i could turn the loop on and let it run for a while to "train" the algo but then periodically query it to test its progress without ever stopping the loop. with something like std::cin i would have to tell it to loop again and again every time i didnt actually need to pass it anything.

I dont really feel like im explaining this very well. I'll come back and edit this if i can think of a better way to explain it.
Last edited on
Either querry keyboard state on each iteration managing buffer state yourself, or use std::thread (or std::async) to run input in another thread.
thanks. i have no idea what that means but i bet i can figure it out. :)

*edit* https://www.youtube.com/watch?v=LL8wkskDlbs
Last edited on
Topic archived. No new replies allowed.