You are on page 1of 19

How to use

Microsoft Visual Studio 2010


(Follow every step!)

E116
Computer
Programming
Starting MS Visual Studio 2010
• Click on Windows Start button and
search for Microsoft Visual
Studio 2010.
• Click on Microsoft Visual Studio
2010 to run the program.

2
Starting MS Visual Studio 2010
• Choose the “Visual C++ Development Settings” in the Choose
Default Environment Settings window that pops up.
• Press Start Visual Studio.

3
Setting up MS Visual Studio 2010

• To show the Error List,


a. Go to View > click on Error List

4
Setting up MS Visual Studio 2010

• Show line number


a. Go to Tools, Options, Click on the “>” arrow beside
Text Editor, Click on the “>” arrow beside “All
Languages”, General
b. Tick on line numbers.

5
Starting MS Visual Studio 2010
• On the screen that appears, click on New Project to create a
new project.

6
Starting MS Visual Studio 2010
• In the New Project window, select Visual C++ under
Install Templates and select Win32 Console
Application.
• Ensure that the Create directory for solution is
unchecked and the Solution Name will be auto populated.
• Browse to a suitable folder Location and specify the project
Name.
• Click OK to proceed.

Every time you open a new


program, you will need to do
these. So, remember these
steps (this and next 5
slides)!
7
Starting MS Visual Studio 2010
• Click Next on the Win32 Application Wizard that pops
up.

8
Starting MS Visual Studio 2010
• In the Application Settings window, do the following
• Ensure that Console application is selected
• Unselect Precompiled header
• Select Empty project
• Then click on Finish

9
Starting MS Visual Studio 2010
• You would have successfully set up your first project if you can
see the following screen!

10
Starting MS Visual Studio 2010
• Next add your source file. The source file is where you will be
typing in your C codes.
• From the Solution Explorer, right click on Source Files,
select Add and choose New Item

11
Starting MS Visual Studio 2010
• In the Add New Item window, select Visual C++ under
Installed Templates.
• Select C++ File (.cpp).
• Enter the Name of your source file.
• Leave the Location unchanged and click Add.

12
Starting MS Visual Studio 2010
• Your newly added source file will be shown under the Source
Files folder in the Solution Explorer.
• The source file is also open for editing as indicated in the open
file tab.

13
Starting MS Visual Studio 2010
• Type the following codes into the source file.
• Once any change is made in the source file, an * will appear
after the file name in the open file tab.
• Save the changes by clicking on the file save icon .. The * will
disappear once file is saved.

14
Starting MS Visual Studio 2010
• Before you can run your program, you need to build the C codes
that you have written.
• Let’s do some configuration before you build your codes.
• From main menu, select Project then click on Properties.

15
Starting MS Visual Studio 2010
• In the Property Pages window, click on Advanced under the
C/C++ options in Configuration Properties.
• In the option Disable Specific Warnings, type in 4996.
• Click OK to close the Property Pages window.

16
Starting MS Visual Studio 2010
• To build your codes, from main menu, select Build and click
on Build Solution.

• The results of your build will be shown in the Output window.


• The Output window should show
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

17
Starting MS Visual Studio 2010
• You can now run your program once you have successfully build
your codes.
• To run your program select Debug from main menu, click on
Start Without Debugging.

• You should see a command prompt


window pop up as follows,

18
Starting MS Visual Studio 2010

End

19

You might also like