Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at...

Post on 17-Jan-2016

218 views 0 download

Tags:

Transcript of Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at...

UsingVisual Studio C++ Express

Ron Grossron.gross@gmail.com

A current copy of this can be found at http://tinyurl.com/2ucaro or this direct linkLast Modified at 04/21/23

Prerequisite

• Installed Visual Studio (see the separate installation guide on the course website)

Run Lola Run

Understanding Projects

• In this course, a Project or Solution is a set of files that will compile into a single executable (.exe) file.

• A project can contain multiple files compiled together. In this course, every project will contain only one .c file (“ex.c”).

• Projects are mandatory even when they contain only one file.

Creating A Project

Project Options

More Project Options

Clean Up

Adding A File

File Options

Note the “.c” extension

Common Error

• Solutions:– Find and delete the file on disk– Add Existing Item

Even More Options

Even More Options

Even More Options

Debug/Release

• Don’t play with this, options are different for Debug/Release

Entering A Program

Auto-Completion

• Activated by CTRL-Space

Compiling / Building

Build Errors

Build Errors

Build Warnings

Running

Basic Debugging

• Step Over (F10) – execute a line

• Step Into (F11) – enter a function

• Step Out (Shift-F11) – exit a function

• Continue (Start Debugging) – F5

Debugging Over the Edge

• The compiler warns you when you try to debug “after the end of the program”.

• Just press OK and F5 to finish the run.

Advanced Debugging

• Add/Remove Break Point – F9

• Edit & Continue – allows modification while the program is running.

Watches

• Manual

• Value Modification

• Locals

Opening Existing Solutions

• We open solutions (“foo.sln”) and not the C files directly.

• Either double-click from Explorer or FileOpenProject/Solution

A Ready Made Solution

• http://www.cs.technion.ac.il/~rgross/CS/template.zip

• Copy into a fresh folder

• Rename all “template” to whatever you want:– In File Names– In File Contents

Questions?