From 2b7c299297e1ccbfd19234c1f81b5563a6a7a1e9 Mon Sep 17 00:00:00 2001 From: Anibal LopezBonilla Date: Wed, 26 Oct 2022 20:50:04 -0700 Subject: Push 3 --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (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 88f2087..2eecbee 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -80,7 +80,7 @@ using std::setw; void GetAndDisplayWelcomeInfo(); void FunctionOne(int varX[], int varY[]); -void FunctionTwo( int varX[], const int varY[], int varZ[]); +void FunctionTwo(const int varX[], const int varY[], int varZ[]); void PrintFunction(const int varX[], const int varY[], const int varZ[]); @@ -100,11 +100,9 @@ int main() // Breakpoint 3 // Put breakpoint on the following line FunctionTwo(varX, varY, varZ); - varZ[0] = -99; PrintFunction(varX, varY, varZ); return 0; - } void GetAndDisplayWelcomeInfo() { @@ -131,9 +129,8 @@ void FunctionOne(int varX[], int varY[]) for (int x = 0; x < SIZE; x++) varY[x] = x + 100; } -void FunctionTwo(int varX[], const int varY[], int varZ[]) +void FunctionTwo(const 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]; } @@ -148,4 +145,4 @@ void PrintFunction(const int varX[20], const int varY[20], cout << "\t" << setw(3) << varX[x] << "\t " << varY[x] << "\t " << varZ[x] << endl; -} +} \ No newline at end of file -- cgit v1.2.3