|
|
|
Its giving this output: On Sun Solaris 8: 0 1 2 2 On Linux: 1 1 1 1 On Windows: 0 1 1 2
Some thoughts:
Incr/decr ops have side effect so arg list values are undefined in this case. It's an excellent example of a classic trap with evaluation order. You may have different results not only on Unix/Windows but also on different implementation on the same system. Be careful with side effect operations.
C language/compiler tells that there is no finite rule for this type of evaluation
Multiple side effects on the SAME variable between sequence points are ALWAYS UNDEFINED within the C language.
http://c-faq.com/expr/evalorder1.html |
|
|
|
Submitted By :
Ritesh Tijoriwala
(Member Since : 6/13/2004 1:49:49 AM)
|
|
|
Job Description :
job - Eat Computers, Drink Computers , Sleep Computers...
hobby - read, Cricket, tennis... |
View all (2) submissions by this author
(Birth Date : 10/10/1980 ) |
|
|