S
S
sudo rm -rf /2017-07-08 09:17:58
linux
sudo rm -rf /, 2017-07-08 09:17:58

How to prevent the program from exiting until a certain character is pressed?

The question is extremely banal, and yet the solution does not want to come to my head in any way .. It also does not work out to formulate the question concisely and competently for a Google query.
The point is this. It is necessary to make sure that the console program does not terminate upon completion of execution, but waits for a certain button to be pressed. The behavior should be the same regardless of the layout for both Windows and Linux.
It could be done.
gets();
But I read somewhere that it is highly undesirable to do so.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question