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

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -