Prevent external console from closing immediately

Answered

In CLion, there's the checkbox "Run in External Console", from the "Run/Debug Configurations". However, when trying to display a simple Hello World, the program opens, and then immediately closes, not letting me see anything. If I request an input from the user, the message is properly displayed, but the program still closes immediately.

Is there a way to stop this behavior, without changing the original code, and still using the external console?

1 comment
Comment actions Permalink

Hello!

It's not implemented yet. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-26053. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

Meanwhile you san use system("pause") in your code.

0

Please sign in to leave a comment.