How to remove the extra details from the debug console?

Viewed 3838

I'm trying to understand visual studio. I would like to only see "Hello my name is hamza" instead of all the details like file location and the message to automatically close the console.

Hello my name is hamza

C:\Users\Amir Hamza\Desktop\4th sem\oop\Home Practice\Learn 1\x64\Debug\Learn 1.exe (process 12036) exited with code 0.

To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.

Press any key to close this window . . .

2 Answers

1,I suggest you could try to go on Tools -> Options -> Debugging -> General,check "Automatically close the console when debugging stops" enter image description here

And then click debug -> start without debugging

enter image description here

enter image description here

2,Or you can choose to add the following code:

system("pause");

And then click debug -> start debugging

enter image description here

You can also call your .exe file from the command prompt (cmd.exe), but then it will show a new command prompt when your program exits.

Alternatively, you can prevent your program from exiting when it is finished, for example by waiting for a key press using the function _getch. Only after the user presses a key will your program terminate as before.

Related