The output is unpredictable according to c / c++ standards, but every compiler has its own implement. As a intuitive solution, arguments will be evaluated in the order of being pushed into stack,which is right-to-left order for c / c++ function. However, as a left value in the list, ++i should be evaluated at the end. So the output probably will be 8 9 6 5.
Answers & Comments
Verified answer
so what is your question?
The output is unpredictable according to c / c++ standards, but every compiler has its own implement. As a intuitive solution, arguments will be evaluated in the order of being pushed into stack,which is right-to-left order for c / c++ function. However, as a left value in the list, ++i should be evaluated at the end. So the output probably will be 8 9 6 5.
The output will be 8 8 6 5
The post and pre increment functions inside the printf function will be executed from right to left.
BTW ,ofcourse error if you didnt put space between int and i :-)
it is undefined
The order of evaluation of function arguments is not specified in the standard.