using visual studio c++ express ron gross [email protected] a current copy of this can be found at...
TRANSCRIPT
![Page 1: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/1.jpg)
UsingVisual Studio C++ Express
A current copy of this can be found at http://tinyurl.com/2ucaro or this direct linkLast Modified at 04/21/23
![Page 2: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/2.jpg)
Prerequisite
• Installed Visual Studio (see the separate installation guide on the course website)
![Page 3: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/3.jpg)
Run Lola Run
![Page 4: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/4.jpg)
![Page 5: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/5.jpg)
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.
![Page 6: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/6.jpg)
Creating A Project
![Page 7: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/7.jpg)
Project Options
![Page 8: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/8.jpg)
More Project Options
![Page 9: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/9.jpg)
Clean Up
![Page 10: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/10.jpg)
Adding A File
![Page 11: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/11.jpg)
File Options
Note the “.c” extension
![Page 12: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/12.jpg)
Common Error
• Solutions:– Find and delete the file on disk– Add Existing Item
![Page 13: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/13.jpg)
Even More Options
![Page 14: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/14.jpg)
Even More Options
![Page 15: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/15.jpg)
Even More Options
![Page 16: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/16.jpg)
Debug/Release
• Don’t play with this, options are different for Debug/Release
![Page 17: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/17.jpg)
Entering A Program
![Page 18: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/18.jpg)
Auto-Completion
• Activated by CTRL-Space
![Page 19: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/19.jpg)
Compiling / Building
![Page 20: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/20.jpg)
Build Errors
![Page 21: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/21.jpg)
Build Errors
![Page 22: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/22.jpg)
Build Warnings
![Page 23: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/23.jpg)
Running
![Page 24: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/24.jpg)
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
![Page 25: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/25.jpg)
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.
![Page 26: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/26.jpg)
Advanced Debugging
• Add/Remove Break Point – F9
• Edit & Continue – allows modification while the program is running.
![Page 27: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/27.jpg)
Watches
• Manual
• Value Modification
• Locals
![Page 28: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/28.jpg)
Opening Existing Solutions
• We open solutions (“foo.sln”) and not the C files directly.
• Either double-click from Explorer or FileOpenProject/Solution
![Page 29: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/29.jpg)
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
![Page 30: Using Visual Studio C++ Express Ron Gross ron.gross@gmail.com A current copy of this can be found at or this direct link](https://reader035.vdocuments.mx/reader035/viewer/2022062518/5697bf791a28abf838c8244f/html5/thumbnails/30.jpg)
Questions?