c - How the expression evaluates? -


can 1 draw precedence tree expression , please explain side effects..values after expression evaluation in c.

int i=-3, j=2, k=0, m; m= ++i || ++j&&++k; 

according me output should -2 3 1 1 gnu c compiler printing -2 2 0 1? want know how?

because j won't evaluated due short circuit evaluation:

m= ++i || ++j && ++k;     ↑ 

at stage, m evaluated 1 regardless of right side of ||. why?

because 1 || anything 1.


Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -