From f91d4065d8bdd393f5f3616f50773b61a7963fab Mon Sep 17 00:00:00 2001 From: prestonderek Date: Wed, 12 Oct 2022 20:45:07 -0700 Subject: Commit for change to for loop and finish of exersizes. --- CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp') diff --git a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp index 22e48f5..752eecc 100644 --- a/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp +++ b/CST116-Ch8-Debugging/CST116-Ch8-Debugging.cpp @@ -57,6 +57,9 @@ //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. //ran to breakpoint 2 and the output is 0-9. +//ran code through the for loop and it only showed me count at 10. This is wrong. +//found that the for loop was closing with a ; before anything else could happen other than count going up. +//code functions as it should now. #include using std::cout; @@ -74,7 +77,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; -- cgit v1.2.3