From 69d1ed9e724de7e6ae576bc8082a1b0bcf28343c Mon Sep 17 00:00:00 2001 From: prestonderek Date: Tue, 18 Oct 2022 10:15:42 -0700 Subject: Commit at end of exercise 1 --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp') 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 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 -- cgit v1.2.3