+ All Categories
Home > Documents > Microsoft Visual C++ 2008 Express Edition Tutorial

Microsoft Visual C++ 2008 Express Edition Tutorial

Date post: 14-Apr-2018
Category:
Upload: juiriarte
View: 280 times
Download: 1 times
Share this document with a friend

of 21

Transcript
  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    1/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html

    Microsoft Visual C++ 2008 Express Edition Tutorial

    First, download the windows installer from Microsoft/Express and then, run the executable. Follow the instructions and install the program. The following

    screenshots will help you install the product:

    Welcome ScreenClick the Next button to continue

    License TermsSelect the "I have read and accept the license terms" option and then, click the Next button to continue

    Destionation FolderClick the Install button to start the installation

    http://www.microsoft.com/express/Downloads/#2008-Visual-CPP
  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    2/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 2

    Download and InstallWait for the download and install operations to finish

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    3/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 3

    Setup CompleteClick the Exit button to finalize the installation

    You can choose to use the command line tools or the graphical user interface to write your programs. To use the command line tools, check this page on MSDN.

    If you would like to use command line tools, we recommend Notepad++ as an editor. It has syntax high-lighting capability, which is very helpful for developers.

    If you do not prefer to use command line tools, you can run the Visual Studio IDE by following these instructions:

    Goto Start -> All Programs -> Microsoft Visual C++ 2008 Express Edition -> Microsoft Visual C++ 2008 Express Edition to run the program.

    After the program launches, follow the steps depicted in the below screenshots:

    Start PageYou should see a page similar to this after you run the program

    http://notepad-plus.sourceforge.net/uk/site.htmhttp://msdn.microsoft.com/en-us/library/bb384838.aspx
  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    4/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 4

    File MenuClick on the File menu, select New menu item and click on the Project menu item to create a new project

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    5/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 5

    New ProjectOn the left, choose Win32 under Project types -> Visual C++

    And, on the right, choose, "W in32 Console Application" under Templates

    Give a name to your p roject, for instance, "HelloWorld" and click OK to create your project

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    6/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 6

    Win32 Application Wizard - WelcomeClick the Next button to continue

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    7/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 7

    Win32 Application Wizard - Application Settings

    Make sure "Conso le Application" and "Empty Project" options are selectedClick the Finish button to finalize

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    8/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 8

    Add New Item MenuRight click on the name of the project, for this case, it is "HelloWorld", and se lect Add menu

    Then, click on the New Item menu

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    9/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 9

    Add New ItemOn the left, choose Code under Ca tegories -> Visual C++And, on the right, choose, "C++ File (.cpp)" under Templates

    Give a name to your file, for instance, "hello.c" and click the Add button to create your file

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    10/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 10

    Hello WorldNow, you can write your code using the editor

    Write a s imple C program as given in the screenshot

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    11/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 1

    Build MenuClick on the Build Solution menu item under the Build menu or just press F7

    You should be able to see the progress on the Output window below

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    12/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 12

    Build SuccessfulAssuming you did not make any typing errors on the previous step, you should see a similar output on the Output w indow

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    13/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 13

    Compile failedIf you try to compile a code which has syntax errors, Output w indow gives a message similar to this: "0 succeeded, 1 failed..."

    In addition, you should be able to s ee the problems from the Error List Window, w hich can be opened from View Menu. Select Other Window sub-menu and click onmenu item.

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    14/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 14

    Compile ErrorsYou can see the errors in the code in the Error list window

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    15/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 15

    Compile WarningsYou can also see the warnings in the Error list window

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    16/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 16

    RunningYou can run your program from the Debug menu. Click on the "Start Without Debugging" menu item or press Ctrl+F5

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    17/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 17

    Run OutputAfter clicking on the "Start Without Debugging" menu item, you should see your program run in a s eparate window.

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    18/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 18

    Above st eps are the necessary steps in order to compile and run C/C++ programs with Microsoft Visual C++.

    However, since C++ is a super-set of C, Visual C++ compiles your code as a C++ code. Therefore, you should make sure that your code is a valid C code.

    If you prefer to use command line tools, check this page to compile your code according to ANSI C standards.

    Otherwise, Visual C++ compiler settings can be configured by following the below two steps:

    Project Properties MenuRight click on the name of the project, for this case, it is "HelloWorld", and click the Properties menu item

    http://msdn.microsoft.com/en-us/library/0k0w269d.aspx
  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    19/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 19

    Property PagesOn the left, select Language under C/C++ under "Configuration Properties"

    On the right, select "Yes (/Za)" for "Disable Language Extensions"Click the Apply button

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    20/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial

    ceng230.ceng.metu.edu.tr/Compilers/ms-cpp.html 20

    Property PagesOn the left, select Advanced under C/C++ under "Configuration P roperties"

    On the right, select "Compile as C Code (/TC)" for "Compile As"Click the OK button to finish

  • 7/30/2019 Microsoft Visual C++ 2008 Express Edition Tutorial

    21/21

    24/04/13 Microsoft Visual C++ 2008 Express Edition Tutorial


Recommended