diff options
| author | DoolyBoi <[email protected]> | 2022-10-26 21:40:07 -0700 |
|---|---|---|
| committer | DoolyBoi <[email protected]> | 2022-10-26 21:40:07 -0700 |
| commit | 993a0d7dbe08da8ef4ad3688a17ba9f449203ab2 (patch) | |
| tree | 78f951f4e03f6a61df8d5bb3fce019c7a1cd36f1 | |
| parent | Completed Debugging exercise 2 (diff) | |
| download | cst116-ch10-debugging-abd00l4h-993a0d7dbe08da8ef4ad3688a17ba9f449203ab2.tar.xz cst116-ch10-debugging-abd00l4h-993a0d7dbe08da8ef4ad3688a17ba9f449203ab2.zip | |
Finished Debugging Exercise 3
| -rw-r--r-- | CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 6 |
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 7043d3d..337b944 100644 --- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp +++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp @@ -81,7 +81,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[]);
@@ -101,6 +101,7 @@ int main() // Breakpoint 3
// Put breakpoint on the following line
FunctionTwo(varX, varY, varZ);
+ varZ[0] = -99;
PrintFunction(varX, varY, varZ);
return 0;
@@ -130,10 +131,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[])
{
for (int x = 0; x < SIZE; x++) // Notice the const SIZE here
varZ[x] = varX[x] + varY[x];
+ varZ[1] = 99;
}
void PrintFunction(const int varX[20], const int varY[20],
const int varZ[20])
|