Taking input while calculating
I'm writing a program where the program is essentially calculating something for an infinite amount of time. I want to be able to check for user input while the program is calculating.
Due to the structure of the program, I figure the best was to do this is to call some sort of CheckForInput() function on (say) every 2000th iteration of the function that is doing the calculating so it checks like every 1/50th of a second.
Actually its not really a user typing something. It's going to be another windows program talking trough some pipe to my program's stdin, so it can't use kbhit. How can I determine if it hasn't "typed" (for lack of a better word) something so I can break out of the CheckForInput function.
I need some pretty detailed info here if anyone has the time.