From 12024f70066009960ec10e0c3ac0c1a27252834f Mon Sep 17 00:00:00 2001 From: JonCr Date: Fri, 28 Oct 2022 02:12:56 -0700 Subject: Finished --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'CST116-Ch10-Debugging') diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp index 1e3d58b..fd1db97 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -80,15 +80,15 @@ using std::setw; void GetAndDisplayWelcomeInfo(); void FunctionOne(int varX[], int varY[]); -void FunctionTwo(const int varX[], const int varY[], int varZ[]); +void FunctionTwo(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! @@ -100,6 +100,7 @@ int main() // Breakpoint 3 // Put breakpoint on the following line FunctionTwo(varX, varY, varZ); + varZ[0] = -99; PrintFunction(varX, varY, varZ); return 0; @@ -126,11 +127,12 @@ 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[]) +void FunctionTwo (int varX[], const int varY[], int varZ[]) { + varX[1] = 99; for (int x = 0; x < SIZE; x++) // Notice the const SIZE here varZ[x] = varX[x] + varY[x]; } -- cgit v1.2.3