aboutsummaryrefslogtreecommitdiff
path: root/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
diff options
context:
space:
mode:
authorJoe Traver <[email protected]>2022-10-11 20:03:26 -0700
committerJoe Traver <[email protected]>2022-10-11 20:03:26 -0700
commit2eeb1893a10d64915e8d144084394e512b6e2fce (patch)
tree2208a4d8e0a6ce67a2709b05433f8077428c08ad /CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp
parentMade more fixes (diff)
downloadcst116-chapter8-debugging-joetraver30-2eeb1893a10d64915e8d144084394e512b6e2fce.tar.xz
cst116-chapter8-debugging-joetraver30-2eeb1893a10d64915e8d144084394e512b6e2fce.zip
Completed exersise 3
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