From 2e0c0ce01ab1260380afa57052d4abe32543ab41 Mon Sep 17 00:00:00 2001 From: Trenton Stark Date: Fri, 14 Oct 2022 23:29:02 -0700 Subject: Completed exercise 1 --- CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (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 eff8980..7da0588 100644 --- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp +++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp @@ -16,11 +16,13 @@ * 7) The execution continues to the function header for GetAge. * 8) Step into one more time. * 9) Why did the address of age and value change? +* The watch was now looking at the local variable "age" for the function GetAge() * 10) Step over the cout and cin statements. * 11) Verify the value entered is stored properly in age. * 12) Step into until the flow returns to main. * 13) Step over one more time. * 14) Why didn't the value entered get transferred back to main? +* Nothing is being done to the data returned from the function call * 15) Stop debugging and fix the error. * 16) Run to Breakpoint 1. * 17) Step over the function call to GetAge. @@ -77,7 +79,7 @@ int main() // Breakpoint 1 // Put breakpoint on the following line - GetAge(); + age = GetAge(); days = CalcDays(age); // Breakpoint 2 -- cgit v1.2.3