diff options
| author | prestonderek <[email protected]> | 2022-10-18 10:15:42 -0700 |
|---|---|---|
| committer | prestonderek <[email protected]> | 2022-10-18 10:15:42 -0700 |
| commit | 69d1ed9e724de7e6ae576bc8082a1b0bcf28343c (patch) | |
| tree | ba3083b05257880d25a9abbce17ca527db18654b /CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | |
| parent | start of exercise 1 (diff) | |
| download | cst116-ch9-debugging-prestonderek-69d1ed9e724de7e6ae576bc8082a1b0bcf28343c.tar.xz cst116-ch9-debugging-prestonderek-69d1ed9e724de7e6ae576bc8082a1b0bcf28343c.zip | |
Commit at end of exercise 1
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
| -rw-r--r-- | CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp index 0e83429..a849a8a 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -62,7 +62,9 @@ //inserted both breakpoints
//started exercise 1
-
+//address of age is 0x000000980093f924{0}
+//the address and value of age changed when entering the function because the function is in another loaction and declares age again.
+//getage properly works now. the int in main has to be assigned to the function
#include <iostream>
using std::cout;
@@ -82,7 +84,7 @@ int main() // Breakpoint 1
// Put breakpoint on the following line
- GetAge();
+ age = GetAge();
days = CalcDays(age);
// Breakpoint 2
|