aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp')
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index 1e3d58b..e31c769 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -84,11 +84,11 @@ void FunctionTwo(const int varX[], const int varY[], int varZ[]);
void PrintFunction(const int varX[], const int varY[],
const int varZ[]);
-const int SIZE = 5;
+const int SIZE = 10;
int main()
{
- int varX[5];
+ int varX[SIZE];
int varY[SIZE];
int varZ[SIZE]; // Notice how we used the const here!
@@ -131,11 +131,17 @@ 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(const 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[-99] = varX[x] + varY[x];
}
void PrintFunction(const int varX[20], const int varY[20],
- const int varZ[20])
+ const int varZ[20]);
{
int x;
@@ -146,3 +152,4 @@ void PrintFunction(const int varX[20], const int varY[20],
<< "\t " << varY[x]
<< "\t " << varZ[x] << endl;
}
+