diff options
| author | Morgan Cyrus <[email protected]> | 2022-10-30 12:26:42 -0700 |
|---|---|---|
| committer | Morgan Cyrus <[email protected]> | 2022-10-30 12:26:42 -0700 |
| commit | ad8be5a37b29265f416d5b1f7a9c468ba20692b0 (patch) | |
| tree | 76b9a15f6e0f027abc62631a01284e075c923694 /CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | |
| parent | removed const (diff) | |
| download | cst116-ch10-debugging-cyrus-main.tar.xz cst116-ch10-debugging-cyrus-main.zip | |
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
| -rw-r--r-- | CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp index 4aec064..0089338 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -111,14 +111,22 @@ * done
*
* 6) Set a breakpoint on Breakpoint 2.
+* done
+*
* 7) Re-enable Breakpoint 2.
+* done
+*
* 8) Run to Breakpoint 2 and make sure you have a watch on the
* variable name.
+* done
+*
* 9) Click on the '+'. Once you see all the elements
* within the array, change the 'Value' (in the Value field)
* for the first element of the array directly within the Watch
* window to the character 'Z'. Notice how the value is updated
* by displaying the new ASCII value too.
+*
+*
* 10) Stop debugging.
* 11) Disable all breakpoints.
*/
@@ -153,7 +161,7 @@ int main() FunctionTwo(varX, varY, varZ);
varZ[0] = -99;
- varX[1] = 99;
+
PrintFunction(varX, varY, varZ);
return 0;
@@ -186,7 +194,15 @@ void FunctionOne(int varX[], int varY[]) void FunctionTwo(int varX[], const int varY[], int varZ[])
{
for (int x = 0; x < SIZE; x++) // Notice the const SIZE here
+ {
varZ[x] = varX[x] + varY[x];
+ if (x == 1)
+ {
+ varX[1] = 99;
+ varZ[x] = varX[x] + varY[x];
+ }
+ }
+
}
void PrintFunction(int varX[20], const int varY[20],
const int varZ[20])
|