++i + ++i + ++i in Java vs C -


possible duplicate:
how explain result of expression (++x)+(++x)+(++x)?

int i=2; = ++i + ++i + ++i; 

which more correct? java's result of 12 or c = 13. or if not matter of correctness, please elaborate. thank you.

there nothing more correct. undefined , called sequence point error. http://en.wikipedia.org/wiki/sequence_point


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -