diff options
| author | Taylor Rogers <[email protected]> | 2022-10-11 08:28:04 -0700 |
|---|---|---|
| committer | Taylor Rogers <[email protected]> | 2022-10-11 08:28:04 -0700 |
| commit | 5c20a89c39aa029e568b45eb157930de98b04fee (patch) | |
| tree | 000b9dd07da8e666d8f0cb6c7f70164213a46c40 /CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp | |
| parent | Answer E3 Q5 (diff) | |
| download | cst116-chapter8-debugging-taylorrog-5c20a89c39aa029e568b45eb157930de98b04fee.tar.xz cst116-chapter8-debugging-taylorrog-5c20a89c39aa029e568b45eb157930de98b04fee.zip | |
Answered E4 Q5, Q6, and Q7
Diffstat (limited to 'CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp')
| -rw-r--r-- | CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp index b6fbd4b..30743e8 100644 --- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp +++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp @@ -61,8 +61,17 @@ * 3) Verify that the contents of count is garbage.
* 4) Step into the loop.
* 5) What is the value stored in count now?
+*
+* 10
+*
* 6) Where was 10 assigned to count?
+*
+* the semicolon at the end of the "for" line
+*
* 7) Fix the problem and re-run to verify.
+*
+* Both i and cout now count from 0 to 9 and then stop.
+*
********************************************************************/
#include <iostream>
using std::cout;
@@ -80,7 +89,7 @@ int main() // Breakpoint 2
// Put a breakpoint on the following line
- for (count = 0; count < 10; count++);
+ for (count = 0; count < 10; count++)
cout << count << endl;
return 0;
|