Download presentation
Presentation is loading. Please wait.
Published byHubert Underwood Modified over 9 years ago
1
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available on Windows, Linux, others –Designed to use g++ and other existing open-source tools –Unfortunately not working on Urbauer Windows machines Visual Studio –Specific to Windows but still widely used Excellent multi-threaded debugger, eases Windows development –Uses Visual C++ (and other tools for other languages) –Works fine on Urbauer machines, so we’ll use this for now
2
CSE 232: C++ Programming in Visual Studio Overview of Today’s Session Start Visual Studio and create a C++ project Look at the code and files it generated automatically Create a simple “hello, world!” program Build, fix, and repeat until the program compiles Set breakpoints and step over lines of the program Look at the program’s output in the debug terminal Stepping off the end of the main program –Into the crtexe.c file from which the main function is called Try printing out the program’s name (in argv[0]) Look at different syntaxes for the main function –How those different forms treat argc and argv, for example
3
CSE 232: C++ Programming in Visual Studio Starting Visual Studio
4
CSE 232: C++ Programming in Visual Studio Choosing Visual C++
5
CSE 232: C++ Programming in Visual Studio Click on Create Project
6
CSE 232: C++ Programming in Visual Studio Choose Win32
7
CSE 232: C++ Programming in Visual Studio Fill in Project Name
8
CSE 232: C++ Programming in Visual Studio Click Finish to Create the Project …
9
CSE 232: C++ Programming in Visual Studio … Which May Take it a While to Do
10
CSE 232: C++ Programming in Visual Studio Visual Studio Generated Several Files
11
CSE 232: C++ Programming in Visual Studio Provided StdAFX Header File
12
CSE 232: C++ Programming in Visual Studio Provided StdAFX Source File
13
CSE 232: C++ Programming in Visual Studio Provided Readme.txt File
14
CSE 232: C++ Programming in Visual Studio Have the Program Print Out Hello, World
15
CSE 232: C++ Programming in Visual Studio Build the Program
16
CSE 232: C++ Programming in Visual Studio What do the Errors Tell Us We Missed?
17
CSE 232: C++ Programming in Visual Studio Corrected Program
18
CSE 232: C++ Programming in Visual Studio Build Again
19
CSE 232: C++ Programming in Visual Studio Successful Compilation
20
CSE 232: C++ Programming in Visual Studio Setting a New Breakpoint
21
CSE 232: C++ Programming in Visual Studio Breakpoint in the main Function
22
CSE 232: C++ Programming in Visual Studio Start Debugging
23
CSE 232: C++ Programming in Visual Studio Debugger Stops at the Breakpoint
24
CSE 232: C++ Programming in Visual Studio Stepping over the First Line
25
CSE 232: C++ Programming in Visual Studio After Stepping Over Once
26
CSE 232: C++ Programming in Visual Studio Program Output in Terminal Window
27
CSE 232: C++ Programming in Visual Studio Stepping Over a Second Time
28
CSE 232: C++ Programming in Visual Studio At The End of the main Function
29
CSE 232: C++ Programming in Visual Studio What if we Stepped Over Once More?
30
CSE 232: C++ Programming in Visual Studio In the crtexe.c file (calls different Mains)
31
CSE 232: C++ Programming in Visual Studio F5 or Continue to Complete the Run
32
CSE 232: C++ Programming in Visual Studio All Done (can close crtexe.c now)
33
CSE 232: C++ Programming in Visual Studio A Couple More Things to Try Exercise: what do you see when you have the program print out argv[0]? –Why does it print that? –What is it printing vs. what we saw in previous sessions? Exercise: change syntax of the main function to match what we used in earlier sessions –What does printing argv[0] show now? –What if you print out the other program arguments?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.