posted 18 years ago
i think this is what happens...
i is 0.
we evaluate the first term (i++). since we have the post increment, we figure what i is, giving us 0 for the value of the term, then we increment i to 1.
we call m(i), where i is now 1.
m(i) prints 1, and returns a 0.
we now do the addition. we previously evaluated that first term to be 0, we add it to the 0 we got back from the function call, and get 0.
i is then assigned the value 0.
[ February 03, 2006: Message edited by: fred rosenberger ]
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors