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

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.

Related

How to run C/C++ code using integrated terminal in Visual Studio

How to launch a C/C++ console application using the integrated terminal in Visual Studio instead of launching a separate terminal window?
To clarify more:
When I press the run button right now, this is what happens:
But what I want is something like this (but it must happen when I press the run button), where the output is directed to a terminal inside the visual studio window, without launching a separate window, this will make it easier when debugging because I won't have to switch between multiple windows:
There is a handy VsConsoleOutput extension for Visual Studio 2019 / 2022 that redirects program output into Output window inside of Visual Studio.
However when installing it i've got an exception complaining about incorrect value of InstalledByMsi value somewhere in manifest. The workaround is to manually open downloaded .vsix package (which seems to be a .zip archive) using WinRAR or something, adjust one line in extension.vsixmanifest file and save updated archive.
<Installation AllUsers="true" InstalledByMsi="false">

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

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.

Console Application not found in Visual Studio 2017 for C#

I am trying to import some C# 2015 Console Code into 2017, and I can't seem to find the Console option for C#. The console option did exist in 2015.
I tried an elevated developer prompt and ran devenv /installvstemplates with no change.
Easiest way to find project template which interest us is to write down it's name in search box (1)
Regular console application is "Console App (.NET Framework)" (2).

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.

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.