diff options
| author | Trevor Bouchillon <[email protected]> | 2022-10-24 17:04:49 -0700 |
|---|---|---|
| committer | Trevor Bouchillon <[email protected]> | 2022-10-24 17:04:49 -0700 |
| commit | ebfc4e157e65b584830cd26c5f4c659bf12f102b (patch) | |
| tree | c9415e59e72c4c23d3242b9db7efce21bf98f398 /CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | |
| parent | Finished Exercise 2 (diff) | |
| download | cst116-ch10-debugging-daboochillin-ebfc4e157e65b584830cd26c5f4c659bf12f102b.tar.xz cst116-ch10-debugging-daboochillin-ebfc4e157e65b584830cd26c5f4c659bf12f102b.zip | |
exercise 3 part 6 done
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
| -rw-r--r-- | CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp index 022e8d1..984e739 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);
+ varZ[0] = -99;
PrintFunction(varX, varY, varZ);
return 0;
@@ -138,9 +139,11 @@ 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];
varZ[x] = varX[x] + varY[x];
}
void PrintFunction(const int varX[20], const int varY[20],
|