aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging
diff options
context:
space:
mode:
authorEvan <[email protected]>2022-10-26 21:56:58 -0700
committerEvan <[email protected]>2022-10-26 21:56:58 -0700
commite42a0886e7445fd473ee54233e03037bf13fa7b5 (patch)
tree197eb2cd862a7e548ae877a331df9508e0a14be3 /CST116-Ch10-Debugging
parentdfg (diff)
downloadcst116-ch10-debugging-evanmihm-e42a0886e7445fd473ee54233e03037bf13fa7b5.tar.xz
cst116-ch10-debugging-evanmihm-e42a0886e7445fd473ee54233e03037bf13fa7b5.zip
dda
Diffstat (limited to 'CST116-Ch10-Debugging')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp8
1 files 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];