aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
diff options
context:
space:
mode:
authorTrevor Bouchillon <[email protected]>2022-10-16 15:39:26 -0700
committerTrevor Bouchillon <[email protected]>2022-10-16 15:39:26 -0700
commit3a5226c77692d4ffe8c05d333859be479a5f18e0 (patch)
treea1f299ad5021cf4a456d432da99db632acdff538 /CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
parentexercise 2 done (diff)
downloadcst116-ch9-debugging-daboochillin-3a5226c77692d4ffe8c05d333859be479a5f18e0.tar.xz
cst116-ch9-debugging-daboochillin-3a5226c77692d4ffe8c05d333859be479a5f18e0.zip
exercise 3 done
Diffstat (limited to 'CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp')
-rw-r--r--CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
index d73e3a8..c5dbdb4 100644
--- a/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
+++ b/CST116-Ch9-Debugging/CST116-Ch9-Debugging.cpp
@@ -62,6 +62,9 @@
* 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?
+* *****************************************************************************************************************
+* The values for both variables change because the print resuts function called them in the wrong order.
+* *****************************************************************************************************************
* 7) Stop debugging and fix the error.
*
* Debugging Exercise 4
@@ -115,7 +118,7 @@ int CalcDays(int years)
return days;
}
-void PrintResults(int days, int age)
+void PrintResults(int age, int days)
{
cout << age << "! Boy are you old!\n";
cout << "Did you know that you are at least " << days << " days old?\n\n";