How can I disable the debug console from showing the file address in my code? - c++

I created a simple program for training purposes in Visual Studio Community Edition 2017 and I'm not having an issue running the program itself but it is showing me the file address for the process its running in the middle of the code in the Debug Console. I'm not sure how to disable this from showing.
I've tried searching Google but honestly I'm not sure how to easily phrase my question so no results really helped.
The program runs perfectly fine with no errors. This is a visual issue
Highlighted area is what I want to get rid of.

You can do it with:
Tools->Options->Debugging->Automatically close the console
Here is a corresponding fragment from the Visual Studio documentation:
Automatically close the console when debugging stops:
Tells Visual Studio to close the console at the end of a debugging session.

Related

How to display Visual Studio Console Application output inside the IDE and not in command prompt?

I recently started C++ programming on Visual Studio and I noticed that it always gives me the console output in the command prompt (CMD).
I am a java programmer and I'm used to working with Eclipse and Netbeans. With those IDEs, I was able to see the console inside the IDE and not in a different separate window.
Is there a way to display the console output inside Visual Studio, like Eclipse and Netbeans do?
It's infuriating. I spent hours looking for this. Visual Studio doesn't have command prompt inside the IDE.
They have it for Visual Studio code - Intergrated command prompt. But not for visual studio 2015 Enterprise. So, in other words, microsoft has command prompt terminal inside the free version of visual studio but not for the paid version
Unfortunately, the answer seems to be no.
In Visual Studio, console applications are displayed on the command prompt and not inside Visual Studio itself. Meaning that Console.WriteLine method and similar ones write your output to the console window because your application type is Console Application.
You are able to write output to Visual Studio itself by using System.Diagnostics.Debug.WriteLine as mentioned on MSDN. That will cause the debug output to appear in the Output Window inside Visual Studio. In case you don't see that view, you can choose to show it by Debug => Windows => Output.
You should bare in mind that this is not what you asked for.
This "solution" is helpful just in case you want to debug parts of your code and don't want to open the command prompt but just see the relevant output inside the IDE.
In addition, you won't be able to give input back in this output view.
The most important thing, you will not be able to execute your application correctly outside of your coding environment. So, it will work only on the IDE but you won't be able to see this output when the application is on its own (as it meant to be as a console application).
Another solution, that you might like, is to work with Eclipse.
You said that you are familiar with Eclipse as a Java developer and now you work with C++ and don't get along with Visual Studio so far.
So, you can download Eclipse IDE for C/C++ Developers.
In there you will be familiar with the IDE and you will be able to display your output inside Eclipse without any weird and unnecessary workarounds.

Want to open command prompt when running a program in visual studio community

My visual studio community 2015 are opening a MFC program when I hit RUN. All over youtube, everyone has command promt automatically opening when hitting the RUN or Local windows debugger button. I want to change it to command promt aswell, does anyone have a solution?
(beginner)
It seems you created an MFC project and when you start this, of course you start an MFC program.
If you want a console application use File->New->Project and select the Win32 console project template.
See this MSDN article for more information.

Program does not proceed to console window

I'm using visual studio 2013 express. I have a program that uses recursion, after multiple edits and compiles. The compiler now compiles the program without error but the program does not run in foreground, instead 3 instances of same program run in the background. Task manager cannot stop the programs and i can no longer click and edit on visual studio(but is still responsive according to task manager). This code works on other systems.I have tried repairing visual studio, deleting debug folder, restarting my PC.
image showing build succeeded and 3 instances of program:
You might have missed to use the linker flag SUBSYSTEM:CONSOLE. MSDN link

Visual Studio 2015 freezes when debugging a cpp code

I've installed Visual Studio 2015 Enterprise. I'm trying to create a c++ OpenGL project, however, it always freezes when I'm debugging(ctrl + f5). I've tried to write a simple program that prints text to the screen and it still freezes. The build completes successfully, projects in C# don't freeze as well. When I'm trying to run the cpp project VS freezes completely and I have to kill the process, running the .exe directly freezes the explorer..
I haven't found any solution to that kind of problem in the web, and I was hoping that someone here will know what to do..
Thanks :)
Try setting a breakpoint on the very first line of your main, click on debug and see if it gets to the breakpoint. If it does, try stepping through until you see what is causing your freeze.
I had exactly the same problem as you. Turns out my Avast anti-virus was causing the issue. I disabled it and now it's working.
I found the answer from this question:
Visual Studio 2015 freezes when finished building

Redirect command prompt output to output window in Visual studio 2012

How can I redirect everything printed onto the command prompt to be printed onto the output window in Visual studio 2012? I am looking for a console as shown in eclipse.
I am developing a console application in visual C++.
I tried "using namespace System::Diagnostic" but this way I don't see any Debug.WriteLine in suggestions. What other alternative do I have?
This question is answered here. Anyway you should try work different approach, you may be used to Eclipse a I believe, you will get used to Visual Studio soon. I never needed to redirect the console output to Output Window.
These two types of outputs has different purposes. Console Output is intended for the application itself (customer) and one Output Window is intended for debugging purposes. You don't want to release debug messages to customer. Right? But you don't want to delete or comment out debug messages every time you release the software.