aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp6
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