aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp18
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])