aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp')
-rw-r--r--CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
index b0552a7..eaa348e 100644
--- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
+++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
@@ -58,6 +58,10 @@
* statement.
* 5) Run the program to Breakpoint 2 and verify that the output
* displayed on the screen is 0 � 9.
+ *
+ * Yes, if I add another breakpoint after the while loop block and run it in debug mode and check the console,
+ * the outputs are 0 to 9. However, the variable i is equal to 10, which makes sense because that is how it
+ * got out of the while loop block.
*
* Debugging Exercise 4
*
@@ -75,13 +79,13 @@ using std::endl;
int main()
{
- int i = -1;
+ int i = 0;
int count;
// Breakpoint 1
// Put a breakpoint on the following line
- while (i < 0)
- cout << i << endl;
+ while (i < 10)
+ cout << i++ << endl;
// Breakpoint 2