Creating Your First C++ Program Using the Visual Studio Express IDE

by Robbie_Greenberg in Circuits > Software

77073 Views, 44 Favorites, 0 Comments

Creating Your First C++ Program Using the Visual Studio Express IDE

Intro_Pic.png

Introduction

The use of computer programs affects our everyday lives. Computers, smart phones, and tablets are all run by a program someone created. These programs range in difficulty depending on the goal of the task at hand. But there is one program every programmer must write (yes even the person who programmed your Iphone). In the computer science world this is called the Hello World program. In order to write this program, you must download an IDE. IDE stands for integrated development environment. Basically, an IDE gives you a place to write and run your program.

This Instructable walks you through how to install an IDE and create the first program every programmer must write. You will be writing this program in the C++ computer language using the Visual Studio Express IDE.

Materials

  • A CD containing the Visual Studio Express 2012 software.
  • A computer running the Windows 7 operating system.

Time and Cost

This Instructable should take about 30 minutes or less to complete. There is no cost involved.

NOTE: Please make sure you read every step fully before executing the instruction. Some of the steps may require you to anticipate what will happen next.

Insert Disk Into Your Computer

Step_#1.png

Place the CD, containing the Visual Studio Express 2012 software, into your computer's disk drive.

Open Folder to View Files

Step_#2.png

A small window should appear in the middle of your screen. Click on the "Open folder to view files" tab. This will take you to the files stored on the CD.

Note: If this window does not appear then click on the Window's start button (usually in the lower left hand corner of your desktop). Then click on the "Computer" tab on the right hand side of the pop up. Once that window appears, there will be a section called "Devices with Removable Storage". You should see an option for a DVD. Double click on that option to bring up the small window.

Double Click on Wdexpress_full.exe

Step_#3.png

Run the .exe file by double clicking on the wdexpress_full.exe tab. This will launch the installation guide for Visual Studio Express 2012.

Agree to the Terms and Conditions

533902779d29c9e84d00004b.jpg

When the installation window appears, click on the box next to the statement that reads, "I agree to the License terms and conditions." This is saying that you are allowing the software to be downloaded to your computer.

Install Visual Studio Express 2012

5339028b9d29c9db3700009b.jpg

After agreeing to the terms and conditions, the bottom "Install" tab will light up. Before clicking on this tab, please be aware that after clicking it a User Account Control window will appear. When this window appears, make sure to click on the yes tab. Now click on the "Install" tab, which will start the install process.

Wait for Visual Studio Express 2012 to Install

533902ab9d29c9e9c600001b.jpg

Wait for the installation to complete. This may take several minutes.

Launch Visual Studio Express 2012

533902bd9d29c9e84d00004c.jpg

Now that the install is complete you are ready to start programming. Click the "Launch" button in the lower portion of the screen. This will launch Visual Studio Express 2012.

Register for Microsoft Visual Studio Express 2012

Before_step_9.png

A new registration window may appear on the screen. If so, click on the Register online tab. This will take you to the online registration for the software. If this window does not appear you may skip to Step 15.

Sign in With Microsoft Account

Before_step_9#2.png

Sign in with your Microsoft Account (You might have an account if you have signed up for Xbox Live). If you do not have an account, click the Sign Up Now tab in the bottom right hand corner of the screen. If you click the Sign Up Now tab, walk through the setup and then move on to step 10.

Continue With Registration

Before_step_9#3.png

Select the country that you are currently residing in as well as the Personal option for the reason for use. After selecting both of those items, click on the Continue button in the bottom right hand corner.

Select Private Use

Before_step_9#4.png

When the next screen appears, select the option that says Private Use. Then after that has been selected, click Continue in the bottom right hand corner.

Copy and Paste Product Key

Before_step_9#5.png

A new screen will appear with the product key. Copy and paste this key into the registration window that appeared in step 8. To copy and paste, you can highlight the whole key and then use Ctrl-c to copy and then Ctrl-v to paste.

Click Next

Before_step_9#6.png

After pasting the product key into the text box, click the next tab in the lower right hand corner of the window. Stop!!! Please be aware that after clicking the next tab, a User Account Control window will appear in the
middle of your screen asking if you want to download this software onto your computer. Click the yes tab.

Click Close

Before_step_9#7.png

After clicking yes on the User Account Control Window, click close in the right hand corner of the registration window. This will now open Visual Studio Express 2012.

Create a New Project

New_step_#9.png

Now that Visual Studio has loaded, it is time to create a new project. Select the New Project... tab on the left side of the screen.

Create a C++ Win32 Console Application

Step_#9.png

A new window will appear. There are two things that need to be selected in this window. First, on the left hand side select the tab that says Visual C++. Then in the middle of the screen select Win32 Console Application. These are both needed in order for the program to know the language that you will be writing in.

Name Your Project

Step_#10.png

After selecting those two tabs, you now need to name your project. Lets name it: First_Program. After typing First_Program into the text field, click on the ok button in the lower right hand corner.

Click Next

Step_#11.png

A new window will pop up. Select the next button in the lower right hand corner of this window.

Create an Empty Project

Step_#12.png

A new window will appear with many options. Select the option that reads, Empty Project, under the additional options section. After clicking on that box, click the finish button in the lower right hand corner of the window. This should bring you to the project page.

Press the Combination of Ctrl-Shift-A on the Keyboard

Now that you have created a new project it is time to create a source file. This is done by pressing the Ctrl-Shift-A combination on the keyboard. Once this combination is pressed, a window will appear.

Create a .cpp File and Name It

Step_#14.png

Select the C++ File (.cpp) option at the top of the window. Then place the name, Hello_World.cpp, inside the name text field.

Add the New File to Your Project

Step_#15.png

After you have selected the C++ File option and named your file, select the Add button in the lower right hand corner of the window. This is take you back to the project screen and add the .cpp file to your project.

Copy and Paste the Code

New_#_17.png

Now you are ready to write your first program. Copy and paste the following code into the text editor portion of the page (the text editor is in the center of the screen). Make sure that your code looks exactly like the code below:

#include <iostream>

using namespace std;

int main()

{

cout << "Hello World!!!!!!!!\n";

return 0;

}

Press Ctrl-F5 on the Keyboard

Once you have written out your code completely, press Ctrl-F5 on the keyboard. This runs your code in what is called a complier.

Select the Yes Tab

Step_#18.png

After pressing Ctrl-F5 a window will appear. Select the Yes tab.

DONE

Step_#_19.png

Congratulations!! You have just completed your first program. Hopefully your output looks the same as the output above. If it doesn't, then go back to Step 23 and make sure you have copied the code correctly.

You should have a sense of accomplishment about what you have done. You have downloaded software onto your computer, created a new programming project within that software, and wrote your first piece of C++ code. Being able to master these steps can prove to be extremely helpful throughout your life. For more information about getting started in the programming and learning more about computer science please see the links below.

http://www.cprogramming.com/begin.html

http://www.cplusplus.com/doc/tutorial/

http://lifehacker.com/5744113/learn-to-code-the-fu...