aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorgan Cyrus <[email protected]>2022-10-30 11:48:20 -0700
committerMorgan Cyrus <[email protected]>2022-10-30 11:48:20 -0700
commit2afaacd75ce4323c9fd22cc5738f274e242f7ec2 (patch)
tree6034eb31f2baab960ed03b8c207d95092d7ac478
parentvarX[1] = 99; (diff)
downloadcst116-ch10-debugging-cyrus-2afaacd75ce4323c9fd22cc5738f274e242f7ec2.tar.xz
cst116-ch10-debugging-cyrus-2afaacd75ce4323c9fd22cc5738f274e242f7ec2.zip
removed const
-rw-r--r--CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
index 4c03c8c..4aec064 100644
--- a/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
+++ b/CST116-Ch10-Debugging/CST116-Ch10-Debugging.cpp
@@ -105,8 +105,11 @@
*
* 5 Obviously there is a problem. Remove the const from the
* function declaration and header for varX.
+* done
*
* 5) Now you should be able to build and execute your code. Do it.
+* done
+*
* 6) Set a breakpoint on Breakpoint 2.
* 7) Re-enable Breakpoint 2.
* 8) Run to Breakpoint 2 and make sure you have a watch on the
@@ -129,9 +132,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(int varX[], const int varY[], const int varZ[]);
const int SIZE = 10;
@@ -181,12 +183,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],
+void PrintFunction(int varX[20], const int varY[20],
const int varZ[20])
{
int x;