aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
index d267801..41d55ae 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Havaldar.cpp
@@ -32,7 +32,7 @@
* correctly from GetAge.
* 19) Stop debugging.
*
-* Debugging Exercise 2
+* Debugging Exercise 2 (not working)
*
* 1) Run to Breakpoint 1.
* 2) Step over the call to GetAge.
@@ -40,6 +40,7 @@
* 4) Step into one more time so that the current line is the
* calculation.
* 5) Why is age greyed out in your watch window?
+* age is not greyed out in the watch window
* 6) Stop debugging.
*
* Debugging Exercise 3
@@ -51,6 +52,8 @@
* 4) Step into the PrintResults function.
* 5) Age is 7300? Not even Ralph is that old.
* 6) Why did the values for both variables change?
+* PrintResults functions requires 2 parameters in the correct order: (days, age). In main() we did the opposite,
+* we wrote PrintResults(age, days) so the values got switched
* 7) Stop debugging and fix the error.
*
* Debugging Exercise 4
@@ -86,7 +89,7 @@ int main()
// Breakpoint 2
// Put breakpoint on the following line
- PrintResults(age, days);
+ PrintResults(days, age);
return 0;
}