diff options
| author | prestonderek <[email protected]> | 2022-10-12 20:39:03 -0700 |
|---|---|---|
| committer | prestonderek <[email protected]> | 2022-10-12 20:39:03 -0700 |
| commit | 10f30af4a84cd3c0ede041bd42754d6e59bfa227 (patch) | |
| tree | ea94157812871bac9e8dbeeb4b629659c344295e | |
| parent | Begin exersize 3. (diff) | |
| download | cst116-chapter8-debugging-prestonderek-10f30af4a84cd3c0ede041bd42754d6e59bfa227.tar.xz cst116-chapter8-debugging-prestonderek-10f30af4a84cd3c0ede041bd42754d6e59bfa227.zip | |
improved the cout statement in the while loop.
| -rw-r--r-- | CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp index bc59f1d..e716833 100644 --- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp +++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp @@ -55,6 +55,7 @@ //Debug 2 ran to breakpoint and the while loop did not execute the cout statement.
//Changed while loop to be i<10.
//Ran the program at start of Exersize 3 and it's infinite 0's!!!
+//added a ++ to i in the cout statement after closing the infinite program.
#include <iostream>
using std::cout;
@@ -68,7 +69,7 @@ int main() // Breakpoint 1
// Put a breakpoint on the following line
while (i < 10)
- cout << i << endl;
+ cout << i++ << endl;
// Breakpoint 2
// Put a breakpoint on the following line
|