From d4748e83ed0c651a21ad84a22ebfa16299087930 Mon Sep 17 00:00:00 2001 From: Lloyd Crawford Date: Wed, 26 Oct 2022 21:45:57 -0700 Subject: Completed to stage 2. --- CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp') 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! @@ -130,12 +130,18 @@ void FunctionOne(int varX[], int varY[]) varY[x] = x + 100; } 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; } + -- cgit v1.2.3