I want to know how to remove the standard debug sentences in command prompt when i run my C++ program RRS feed

  • Question

  • Good Morning, Evening, or Night Everybody.

    Today I decided to try and make my first C++ program and wrote a Hello World Script and a line that would spit out "Complete" when my program is successfully run in debug mode.

    I want to be able to remove the standard " To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops." Line from the console

    I am using Visual Studio 2019 on Windows 10 (1903)

    Thank you for looking at my post and please have a nice day

    I am also attaching a copy of my code 

    #include <iostream>
    #ifdef _DEBUG
    #define PRINTSTUFF(stuff) std::cout << (stuff);
    #define PRINTSTUFF(stuff)
    using namespace std;
    int main()
    	std::cout << "Hello World!\n";

    Tuesday, August 20, 2019 1:05 PM

All replies

  • This text is not "standard", it is artifact of Visual Studio. Many new users find it helpful. Just run your program in a normal command prompt outside of VS.

    -- pa

    Tuesday, August 20, 2019 1:31 PM
  • You would have to provide feedback to Microsoft then. Click on the Send Feedback button near the top right of the Visual Studio window.

    If you actually disable the feature, like the text states, or even run your application in the command prompt like Pavel suggests, you will notice that this text doesn't appear. Visual Studio has to use a script or some kind of mini executable to run your application in the debugger for the console window not to close.

    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Tuesday, August 20, 2019 1:46 PM