Jump to content

Visual Studio Help

BrownZeus

hey all, so I'm learning C++ via online instruction through udemy, and the IDE I'm using is Visual Studio Enterprise (cause I get it free from school).

 

I'd like to have it set so that my program outputs to Visual Studio's console at the bottom.

For example in Netbeans or Eclipse output for a Java program will go straight to the the respective IDE's own output console.

 

What I get in Visual Studio's output console is just an output of whats happening with the program, not the actual program output. By default Visual Studio will start up Command Prompt, run the program and then close the Command Prompt upon completion. As a result, simple programs like Hello World will simply flash on the screen before I can even look at the output. The only work around I know of is adding a pause in the program, but I don't wanna do that. I'd just rather look at output in Visual Studio's console.

 

If anyone knows where to find and configure that setting, please let me know.

Link to comment
Share on other sites

Link to post
Share on other sites

If you have a UI based program (windows form), you can select "Output" on the bottom center:

Capture.thumb.PNG.269995c8d33d3c0a21d369440fd26505.PNG

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, dany_boy said:

If you have a UI based program (windows form), you can select "Output" on the bottom center:

Capture.thumb.PNG.269995c8d33d3c0a21d369440fd26505.PNG

This is what I have. Output only shows debugging info, not program output. Same thing for Hello World (The program in my screenshot obviously isn't hello world)

Screenshot (2).png

Link to comment
Share on other sites

Link to post
Share on other sites

On the other hand if your code is console only, you might want to try with CTRL+F5:

Capture.thumb.PNG.a2df08228418ea2e06af6ce907f10dc8.PNG

Quote or tag if you want me to answer! PM me if you are in a real hurry!

Why do Java developers wear glasses? Because they can't C#!

 

My Machines:

The Gaming Rig:

Spoiler

-Processor: i5 6600k @4.6GHz

-Graphics: GTX1060 6GB G1 Gaming

-RAM: 2x8GB HyperX DDR4 2133MHz

-Motherboard: Asus Z170-A

-Cooler: Corsair H100i

-PSU: EVGA 650W 80+bronze

-AOC 1080p ultrawide

My good old laptop:

Spoiler

Lenovo T430

-Processor: i7 3520M

-4GB DDR3 1600MHz

-Graphics: intel iGPU :(

-Not even 1080p

 

Link to comment
Share on other sites

Link to post
Share on other sites

The window inside VS is for debug output. You can write to it using OutputDebugString. However like the name says that's only for debug stuff, don't use it for normal input/output.

 

For simple programs you can run your program without debugging using ctrl + f5 or the option in the menu which keeps the console window open after the program finishes. If you need the debugger you can set a breakpoint at the last line of the program.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

All I want is to be able to read my actual program output in Visual Studio's window itself.

 

Like in Eclipse CDT, C++ programs output to Eclipse CDT's console at the bottom of the ide window at runtime unless the program is gui based.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, BrownZeus said:

All I want is to be able to read my actual program output in Visual Studio's window itself.

 

Like in Eclipse CDT, C++ programs output to Eclipse CDT's console at the bottom of the ide window at runtime unless the program is gui based.

As far as I'm aware, Visual Studio doesn't have the functionality you're looking for. This may work for you (I'm not sure because they aren't talking about C++) but it's not really a great solution. I suggest you just get used to the command line window popping up when you run your application.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×