Answer the question
In order to leave comments, you need to log in
Correct non-closing windows console window?
Already tired of this ..
Before, I just wrote
cin.get () cin.get(
)
got tired of
system(“pause”)
getch()
is also a crutch !
What else do you have ?
Ideally, to write quit from the keyboard to exit
. How is this solved in serious projects?
PS Visual Studio 2015
Answer the question
In order to leave comments, you need to log in
It is with such crutches that it is decided. The input is read, parsed for commands, and these same commands are executed.
In general, the program usually closes immediately when it has done everything that was asked of it in the parameters. Look at the behavior of the same ping - it does not wait for any exit command from you. Pinged and returned control to the console.
There really is such a possibility. This is done in the project settings as follows:
When you run the project without debugging (Ctrl + F5), the desired result will be achieved.
In general, yes, they answered correctly above: completed - finish the job. Constant reading loop std::cin
How it dares in serious projects?
Before, I just wrote
cin.get()
cin.get()
got
system(“pause”)
getch()
was also a crutch !
And why did you decide that these are crutches? Why should your program just hang and not close if it's not doing anything? If not all threads have worked, you need to wait for the threads. If the program starts something on a timer, then it needs some kind of command to close from the user => listen to input. Everything is logical, what are you missing?
And drive abcd0x00 in the neck, Linux came here to advertise, but the same thing there) Programs work according to the same principles here and there, and I haven’t heard something that they could just hang. In any case, he would have said so, and not just "left Linux here."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question