printf - Printing order in C -


int x=10; printf("%d %d %d\n",x,++x,x++); printf("%d %d %d",x,x+20,x+30); 

it printing output as

12 12 10 12 32 42 

why order in first printf in reverse order , why not in second printf statement? found in book c uses reverse printing order.

your code has undefined behavior ("ub"). thus, can happen.

specifically, rule violated 1 must not read , write same variable without sequence-point except determine value write.


Comments

Popular posts from this blog

Why can rails not find a route created by a helper? -

javascript - jquery or ashx not working -

php - Redirect and hide target URL -