c++ - Interrupt cin while loop without the user entering input -


In the main , I give the user the ability to enter commands to stop the application:

  while (run_processes and amp; cin & gt; & gt; Kmmand_lain_input) { 

I set to stop anywhere app Wish / run_processes = false; .

However, when i would run_processes set to false , then stops without entering the above loop user input.

How can I properly interrupt the loop without entering user input?

portable way std :: cin is not possible to disrupt.

You can still solve a non-portable solution, e.g. Manually poll () standard input on a UNIX system and check run_processes while voting.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -