aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
diff options
context:
space:
mode:
authorprestonderek <[email protected]>2022-10-21 10:40:55 -0700
committerprestonderek <[email protected]>2022-10-21 10:40:55 -0700
commit860d2d9f4f6e6c0291d5ecc25e9667e6d6faf199 (patch)
tree1b0f6532ed436045b7cb37e99e0bfc167e5acc69 /CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
parentadded the assignment statement for varZ in exercise 3 (diff)
downloadcst116-ch10-debugging-prestonderek-860d2d9f4f6e6c0291d5ecc25e9667e6d6faf199.tar.xz
cst116-ch10-debugging-prestonderek-860d2d9f4f6e6c0291d5ecc25e9667e6d6faf199.zip
removed const identifier from varX in the declaration and header
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index 590cb43..ee63d02 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -80,9 +80,8 @@ using std::setw;
void GetAndDisplayWelcomeInfo();
void FunctionOne(int varX[], int varY[]);
-void FunctionTwo(const int varX[], const int varY[], int varZ[]);
-void PrintFunction(const int varX[], const int varY[],
- const 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,9 +98,11 @@ int main()
// Breakpoint 3
// Put breakpoint on the following line
+
+ varX[1] = 99;
FunctionTwo(varX, varY, varZ);
- varZ[1] = -99;
+ varZ[0] = -99;
PrintFunction(varX, varY, varZ);
@@ -133,13 +134,12 @@ 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];
}
-void PrintFunction(const int varX[20], const int varY[20],
- const int varZ[20])
+void PrintFunction(const int varX[20], const int varY[20], const int varZ[20])
{
int x;
cout << " \t x \t y \t z\n\n";