After compiling console programs the console window closes immediately after running. What is the best practice for keeping it open? I've searched google loads, I'm used to codeblocks where you don't have to worry about it, but, I want to mess around with Visual Studio a bit and with VS, my console closes. All over the interwebz there are several different ways to keep it open, however, I've read that most of them are bad coding techniques. What is everyones preferred method?
C++ – the Best Practice for Combating the Console Closing Issue
c++consolewindows
Related Question
- C++ – What does the explicit keyword mean
- C# – How to get the application’s path in a .NET console application
- C++ – the effect of extern “C” in C++
- C++ – the “–>” operator in C/C++
- Visual-studio – Preventing console window from closing on Visual Studio C/C++ Console application
- C++ – the copy-and-swap idiom
- C++ – The Rule of Three
- C++ – What are the basic rules and idioms for operator overloading
Best Solution
When I'm using Visual Studio and I don't need debugging I just run it using Ctrl+F5 keystroke – and it prevents console from closing.