From 27722aef2729dc79d15a96492c4e4f9192d0fcd1 Mon Sep 17 00:00:00 2001 From: Morgan Cyrus Date: Sun, 30 Oct 2022 11:15:57 -0700 Subject: changed to SIZE --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp') diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp index 4096fdd..70c9288 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -51,10 +51,13 @@ /* Debugging Exercise 2 * * 1) Change the constant SIZE from 5 to 10. +* done * * 2) Change any literal containing a 5 to the constant SIZE. * Notice the usefulness of the constant when changes need * to be made to your code. +* +* * 3) Set a breakpoint at Breakpoint 4. Now on this breakpoint * set the necessary condition so the loop breaks when x hits 8. * (Hint: If you need help setting breakpoints based upon a @@ -112,7 +115,7 @@ const int SIZE = 10; int main() { - int varX[5]; + int varX[SIZE]; int varY[SIZE]; int varZ[SIZE]; // Notice how we used the const here! @@ -150,7 +153,7 @@ void FunctionOne(int varX[], int varY[]) // Put breakpoint on the following line varX[x] = x; - for (int x = 0; x < 5; x++) + for (int x = 0; x < SIZE; x++) varY[x] = x + 100; } void FunctionTwo(const int varX[], const int varY[], int varZ[]) -- cgit v1.2.3