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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
index f3a6c6f..a1dd815 100644
--- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
+++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
@@ -35,6 +35,9 @@
*
* 1) Run the program without debugging.
* 2) What is happening now is an infinite loop.
+*
+* -i is less than zero so it will continuously output a zero because the variable value will always be less than 10-
+*
* 3) End your program by holding down the Ctrl key and pressing C.
* 4) Fix the problem by adding a "++" after the i in the cout
* statement.
@@ -62,8 +65,8 @@ int main()
// Breakpoint 1
// Put a breakpoint on the following line
- while (i < 0)
- cout << i << endl;
+ while (i < 10)
+ cout << i++ << endl;
// Breakpoint 2
// Put a breakpoint on the following line