View Single Post
  #6  
Old February 27th, 2004, 02:21 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: 2.08 and Incompatible Battle Reports

Quote:
Originally posted by E. Albright:
quote:
Originally posted by alexti:
Some Languages consider line feeds as a language element, but not C/C++.
code:
f(); f();

and
code:
f();
f();

are the same thing.
Fair enough. However, Arryn was suggesting that your example was not analogous because the calls were in seperate statements (tho' to be fair, she used the term "lines", so the confusion is understandable).

Here's where those examples came from:
Quote:
Originally posted by Arryn:
[qb]The problem comes in that the compiler's optimization will substitute the same call to the random number function for both die rolls. It won't make the two rand() calls the coders intend. What it does is make one call and plug the same value into both places. The optimizer does not know that in this circumstance, two calls to the same function do not return the same value.
And in all 3 cases f shall be called twice:
code:
  f(); f();

f(), f();

f()+f()

Edit: Fixed quotations. Again.
P.S. I want real forum/client

[ February 27, 2004, 00:23: Message edited by: alexti ]
Reply With Quote