Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to catch the stderr and stdout in Visual Studio?

Tags:

Is there a way to catch the stdout and stderr in Visual Studio? For example, when I use

cout <<"Hello world!"<< endl; 

A black window appears and disappears. It's so fast that I can't see it. There is a output section in the IDE but it only allow me to choose display output from build and something else but without the choice of stdout.

A cheating solution maybe calling

system("pause"); 

but it doesn't sound right. I searched in the option but I can't find an item.

Anyone has any idea? Thanks. I just start to use VS and I'm on Linux before.

like image 703
YankeeWhiskey Avatar asked Apr 19 '12 23:04

YankeeWhiskey


People also ask

How do I check output in Visual Studio?

The Output window displays status messages for various features in the integrated development environment (IDE). To open the Output window, on the menu bar, choose View > Output, or press Ctrl+Alt+O.

How do you calculate stderr?

The standard error is calculated by dividing the standard deviation by the sample size's square root. It gives the precision of a sample mean by including the sample-to-sample variability of the sample means.


2 Answers

Rather than using the "Start Debugging" command, if you want to check the output, use "Start Without Debugging". That's generally how I handle it. The command prompt window will remain up until you close it. If there's a crash or something, you can always reattach Visual Studio to the process, or just run it with "Start Debugging".

like image 152
Nicol Bolas Avatar answered Oct 06 '22 04:10

Nicol Bolas


Go to Project Properties -> Linker -> System -> Change subsystem to Console.

like image 31
Iceman Avatar answered Oct 06 '22 05:10

Iceman