Visual Studio Starting Guide
If you've never written a line of code, Visual Studio can seem like the control panel of a cockpit. In reality, it's a combination of tools that helps you write, organize, and debug code. Think of it like Microsoft Word for programming.
1. Installing Visual Studio
Visual Studio runs on Windows, and the installation is pretty straightforward. Go to visualstudio.microsoft.com. Find the "Download" button for "Visual Studio Community". It's free and has everything you need. Run the installer, and click your way through. The installer launches a menu of "workloads." These are modules that add tools to Visual Studio. Make sure that "Desktop development with C++" is selected. [IMG] Click "Install" and wait. Visual Studio is big, so the installation might take a while. Go make some tea, or read the other sections of this article :)
2. Creating Your First Project
After installing and launching Visual Studio, you can select if you want to "Create a new project" or "Open a project." Click "Create a new project." [IMG] Visual Studio will present templates for different types of applications. In the beginning, we'll stick with the console app. Starting a console app gives us a good interface for outputting and inputting text, which is perfect for learning programming. You can customize the project name and storage location on your computer if you want to. Then click "Create".
3. The Visual Studio Layout
Visual Studio is big because it wants to be able to handle anything you throw at it. Luckily, we only need to know a few tools to get started. [IMG - with solution explorer, editor window, output, and toolbar highlighted and labled] Solution Explorer: This is your project's file cabinet. Code files, images, or other resources you include show up here. Editor Window: This is where you do your actual work. You'll type your code here, change it, and run it. Toolbars and Menus: At the top are commands for building, running, and debugging your application. There are also many other tools and options to customize Visual Studio, but we don't have to worry about those now. Output Window: Visual Studio outputs information from processes like the compilation into this window. In addition to showing compilation progress, it can help you diagnose errors in your code.
4. Writing and Running Code
Visual Studio probably created a starter file for you with a simple "Hello, World!" program written out.
[VS Example program]
If not, copy the code above into your editor window. Once you're set up - hit the green play button, and it'll compile and run your code. A console window should pop up with the text "Hello, World!".
Congratulations!
You've now created your first program!
Code Snippets
00:05-00:14
// Include the hello world example here.