From ad8be5a37b29265f416d5b1f7a9c468ba20692b0 Mon Sep 17 00:00:00 2001 From: Morgan Cyrus Date: Sun, 30 Oct 2022 12:26:42 -0700 Subject: Finished. --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp') 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]) -- cgit v1.2.3