aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
diff options
context:
space:
mode:
authorTrevor Bouchillon <[email protected]>2022-10-24 16:53:03 -0700
committerTrevor Bouchillon <[email protected]>2022-10-24 16:53:03 -0700
commite9b1197ae0984ee945492a38b587a934c81fef9a (patch)
treeb735f93fbf433a4d31926f88469ae7ccbcfa4f30 /CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
parentExercise 1 done (diff)
downloadcst116-ch10-debugging-daboochillin-e9b1197ae0984ee945492a38b587a934c81fef9a.tar.xz
cst116-ch10-debugging-daboochillin-e9b1197ae0984ee945492a38b587a934c81fef9a.zip
Finished Exercise 2
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index 80b7568..022e8d1 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -42,6 +42,9 @@
* set the necessary condition so the loop breaks when x hits 8.
* (Hint: If you need help setting breakpoints based upon a
* condition refer to Chapter 8).
+* ********************************************************************************
+* To do this I just changed SIZE to equal 8.
+* ********************************************************************************
* 4) Run to Breakpoint 4.
* 5) Continue stepping into the remainder of the for loop until the
* flow returns back to main.
@@ -90,11 +93,11 @@ void FunctionTwo(const int varX[], const int varY[], int varZ[]);
void PrintFunction(const int varX[], const int varY[],
const int varZ[]);
-const int SIZE = 5;
+const int SIZE = 8;
int main()
{
- int varX[5];
+ int varX[SIZE];
int varY[SIZE];
int varZ[SIZE]; // Notice how we used the const here!
@@ -132,7 +135,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[])