aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging
diff options
context:
space:
mode:
authorTrenton Stark <[email protected]>2022-10-22 12:23:35 -0700
committerTrenton Stark <[email protected]>2022-10-22 12:23:35 -0700
commit7bcfa8d20bf9500dc051cbe251a3f21aa058a0df (patch)
tree7a8721574bad5ee9dd54d1e5f93ed5e1ffe9e356 /CST116-Ch10-Debugging
parentCompleted excersize 2 (diff)
downloadcst116-ch10-debugging-stark-7bcfa8d20bf9500dc051cbe251a3f21aa058a0df.tar.xz
cst116-ch10-debugging-stark-7bcfa8d20bf9500dc051cbe251a3f21aa058a0df.zip
Completed exercise 3
Diffstat (limited to 'CST116-Ch10-Debugging')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index ac3c08a..553debb 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(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 = 10;
@@ -99,6 +99,7 @@ int main()
// Breakpoint 3
// Put breakpoint on the following line
FunctionTwo(varX, varY, varZ);
+ varZ[0] = -99;
PrintFunction(varX, varY, varZ);
return 0;
@@ -128,8 +129,9 @@ 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[])
{
+ varX[1] = -99;
for (int x = 0; x < SIZE; x++) // Notice the const SIZE here
varZ[x] = varX[x] + varY[x];
}