From e42a0886e7445fd473ee54233e03037bf13fa7b5 Mon Sep 17 00:00:00 2001 From: Evan Date: Wed, 26 Oct 2022 21:56:58 -0700 Subject: dda --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp index 06003ef..29901ff 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -46,12 +46,8 @@ * array varZ to -99. * 2) Build and execute your code, verifying that the calculations * are correct in relation to element 0 of varZ. -* -* * 3) Add a line to assign the contents of the second element of * varX to 99 in FunctionTwo. -* -* * 4) Rebuild your program. * 5 Obviously there is a problem. Remove the const from the * function declaration and header for varX. @@ -78,7 +74,7 @@ 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[99], const int varY[], int varZ[]); void PrintFunction(const int varX[], const int varY[], const int varZ[]); @@ -127,7 +123,7 @@ void FunctionOne(int varX[], int varY[]) for (int x = 0; x < 10; x++) varY[x] = x + 100; } -void FunctionTwo(const int varX[], const int varY[], int varZ[]) +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]; -- cgit v1.2.3