Question:If i == 0, why is (i += i++) == 0 in C#? 

A source code i += i++; abstract syntax tree += i i (post) ++ 

B First, i++ returns 0. Then i is incremented by 1. Lastly i is set to the initial value of i which is 0 plus the value i++ returned, which is zero too. 0 + 0 = 0. 

C int i = 0; i = i + i; i + 1; 

D int ++(ref int i) { int c = i; i = i + i; return c;} 

+ Answer
+ Report
Total Preview: 773

Copyright © 2024. Powered by Intellect Software Ltd