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

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -