

For more information, see Using the Visual Studio IDE for C++ Desktop Development. Once you've built and run this simple app, you're ready for more complex projects. Press Enter to run your app.Ĭongratulations, you've built and run a console app in Visual Studio! In the command prompt window, right-click to paste the path to your app into the command prompt. Enter cmd.exe in the Open textbox, then choose OK to run a command prompt window. To open a command prompt window, press Windows+R to open the Run dialog. Choose Copy as path to copy the path to your app to the clipboard.

Hold down the Shift key and right-click on HelloWorld.exe to open the context menu. This folder contains your app, HelloWorld.exe, and a couple of other debugging files. In the File Explorer window, open the Debug folder. Choose Open Folder in File Explorer to open a File Explorer window in the HelloWorld solution folder.

In Solution Explorer, select the HelloWorld solution (not the HelloWorld project) and right-click to open the context menu. Here's how to find and run your new app in a command prompt window. Once your app is built by Visual Studio, you can run it from any command window. Normally, you run console apps at the command prompt, not in Visual Studio. " to give you a chance to see the output.Ĭongratulations! You've created your first "Hello, world!" console app in Visual Studio! Press a key to dismiss the console window and return to Visual Studio. When you start a console app in Visual Studio, it runs your code, then prints "Press any key to continue. To run the code, on the menu bar, choose Debug, Start without debugging.Ī console window opens and then runs your app. The Output window shows the results of the build process. To build your project, choose Build Solution from the Build menu. If Visual Studio looks like this, you're ready to build and run your app: If you haven't done this step yet, follow the steps in Create a C++ console app project. If it's not installed yet, follow the steps in Install C++ support in Visual Studio.Ĭreate a "Hello, World!" project and enter its source code. Have Visual Studio with the Desktop development with C++ workload installed and running on your computer. Then, run it as a stand-alone app from the command line. Now you can build and run it within Visual Studio. You've created a C++ console app project and entered your code.
