aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaylor Rogers <[email protected]>2022-10-26 09:05:12 -0700
committerTaylor Rogers <[email protected]>2022-10-26 09:05:12 -0700
commit123f4e355ffd339ad983c3b08425e7998ad8a15d (patch)
treeaea67dcf4dad7f7e5ff2de928c115a0ddc19973e
parentchanged first element of varZ to -99 (diff)
downloadcst116-ch10-debugging-taylorrog-123f4e355ffd339ad983c3b08425e7998ad8a15d.tar.xz
cst116-ch10-debugging-taylorrog-123f4e355ffd339ad983c3b08425e7998ad8a15d.zip
Completed exercise
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index 7689bbc..62f23e3 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -89,7 +89,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[], const int varY[], int varZ[]);
void PrintFunction(const int varX[], const int varY[],
const int varZ[]);
@@ -109,6 +109,7 @@ int main()
// Breakpoint 3
// Put breakpoint on the following line
FunctionTwo(varX, varY, varZ);
+ varX[1] = 99;
varZ[0]=-99;
PrintFunction(varX, varY, varZ);
@@ -139,7 +140,7 @@ void FunctionOne(int varX[], int varY[])
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[])
{
for (int x = 0; x < SIZE; x++) // Notice the const SIZE here
varZ[x] = varX[x] + varY[x];