I/O ouput code

HEY am having some trouble. I'm writing a stoplight controller program and the problem that am having is that during the execution at any random time must accept input from an external source. Am having problems getting this done
What have you done so far?
What is the external input source? a keyboard? or something else?
What environment are you writing this in? A dedicated controller? A PC? Or?
yeah thnx 4 tha reply. what I've basically done is that ive defined the different states for the stoplights and they change states after a certain time and display the state that its in. all of this is enclosed in a while loop, so that the program will repeat itself continuously. it must accept an input from the keyboard for no.

am using the code blocks compiler(PC)
you can use the Ctrl+Z character on Windows to signal something like an "interrupt" so that you exit the loop, but you need to make sure that the loop is cin-dependent.
Last edited on
Topic archived. No new replies allowed.