diff options
| author | Trevor Bouchillon <[email protected]> | 2022-10-24 16:53:03 -0700 |
|---|---|---|
| committer | Trevor Bouchillon <[email protected]> | 2022-10-24 16:53:03 -0700 |
| commit | e9b1197ae0984ee945492a38b587a934c81fef9a (patch) | |
| tree | b735f93fbf433a4d31926f88469ae7ccbcfa4f30 | |
| parent | Exercise 1 done (diff) | |
| download | cst116-ch10-debugging-daboochillin-e9b1197ae0984ee945492a38b587a934c81fef9a.tar.xz cst116-ch10-debugging-daboochillin-e9b1197ae0984ee945492a38b587a934c81fef9a.zip | |
Finished Exercise 2
| -rw-r--r-- | CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 9 |
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[])
|