
22 Jun
2009
22 Jun
'09
9:47 p.m.
It's a basic question and i'm sure alot of you can answer this but i'm still a bit sure. Take a look at the code below. #include <stdio.h> main() { int i, j; for (i=0, j=1; i<8; i++, j++) printf("%d - %d = %d\n", j, i, j - i); return 0; } Now the results yielded are 1 - 0 = 1 2 - 1 = 1 ... 8 - 7 = 1 i'd like to know what the delimiting factor here is, i.e. considering i've not set a loop limit for j, what's stopping my calculation from being as follows.. 148 - 8 = 0 as an example though from my understanding, it should present an infinite loop. I\ve been pondering this a while, thought i'd get some Guru's out there to help out with my understanding of this. Rahim.