January 16th, 2013, 11:53 PM
Nested for loop unexpected behavior
Hi i'm a C# coder and new to C but the code below has been giving me some weird behavior.
The output i'm receiving from the console window reads.
printf("i=%d j=%d \n",i,j);
etc.. but (i) starts at 5 for some reason so i decided to debug the code to see what the problem was. As i started to step through the code i got a different output.
Now since i'm stepping through my code it's giving me a different output? What am i missing here?
January 17th, 2013, 12:01 AM
Are you sure it's not just scrolling off the screen? Why don't you put another getchar right after the j-loop so that you can see each iteration of i?
January 17th, 2013, 12:07 AM
Lol you were right wow i'm a noob for sure thanks.
Originally Posted by dwise1_aol