aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging
diff options
context:
space:
mode:
authorDoolyBoi <[email protected]>2022-10-18 19:41:39 -0700
committerDoolyBoi <[email protected]>2022-10-18 19:41:39 -0700
commit1af42e5e545ffb86340fd19e2e57a41678bd8548 (patch)
treed7199fc037a797b20cc0207b5487c95bd5962af7 /CST116-Ch9-Debugging
parentfinished debugging exercise 1 (diff)
downloadcst116-ch9-debugging-abd00l4h-1af42e5e545ffb86340fd19e2e57a41678bd8548.tar.xz
cst116-ch9-debugging-abd00l4h-1af42e5e545ffb86340fd19e2e57a41678bd8548.zip
finished debugging exercise 3 and updated debugging exercise 2 with technical diffculties
Diffstat (limited to 'CST116-Ch9-Debugging')
-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;
}