Introduction to Programming in C

Index   |   Using VC++
 
Introduction
Basic Output
Variables
Conditionals
Loops
Example 1
More on Conditionals
Further Exploration
Algorithm Design
10 Arrays
 
 

Visual C++ Express

 

Visual C++ Express is a free download from Microsoft's site. I do the install without the SQL option (since I'm not using it and that saves some disk space). After it's installed, I go to Tools/Options, select the Startup item in the Environment group, and set "At Startup" to "Show empty environment" and uncheck the "Download content" checkbox.

Here are the steps to create a project in Visual C++ Express:

  • Create a new project:
    • Start Visual C++ Express 2005 (hereafter referred to as VC++).
    • Select File/New/Project
    • In the Project types panel, choose General.
    • In the Templates panel, choose Empty Project.
    • In the Name edit, enter [your project name].
    • (Leave Location and Solution Name alone, and leave Create directory for solution checked.)
    • Click OK.
  • Create a file called main.c for your code:
    • Select Project/Add New Item.
    • In the Categories panel, choose Code.
    • In the Templates panel, choose C++ File (.cpp).
    • In the Name edit, enter main.c (note that we are using the C suffix, .c, not the default C++ suffix).
    • Click Add.

Using Visual C++ Express:

  • Select Build/Build Solution (or hit F7) to build your code into an executable program.
  • Look at the Output window/tab at the bottom to check for errors. Double-click on error reports to highlight the corresponding code.
  • Select Debug/Start Without Debugging (or hit Ctrl-F5) to run your program. VC++ will open a command line window to show your program's output.