diff options
| author | tafaar <[email protected]> | 2022-10-25 12:41:48 -0700 |
|---|---|---|
| committer | tafaar <[email protected]> | 2022-10-25 12:41:48 -0700 |
| commit | c76b093be94016ac2bd5b329ce60fe7e372349fd (patch) | |
| tree | ac6483c12a82c8da53771da79f4a809f9065045e /CST116-Ch10-Debugging | |
| parent | Did part 1 (diff) | |
| download | cst116-ch10-debugging-hill-c76b093be94016ac2bd5b329ce60fe7e372349fd.tar.xz cst116-ch10-debugging-hill-c76b093be94016ac2bd5b329ce60fe7e372349fd.zip | |
changed 5s to size and size to 10
Diffstat (limited to 'CST116-Ch10-Debugging')
| -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 7108569..97122dd 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -35,6 +35,9 @@ * 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.
+*
+* Done
+*
* 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
@@ -87,11 +90,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 = 10;
int main()
{
- int varX[5];
+ int varX[SIZE];
int varY[SIZE];
int varZ[SIZE]; // Notice how we used the const here!
@@ -129,7 +132,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[])
|