Confused about printf (), which contains the prefix and postfix operators

If int var = 20, then how

printf("%d %d %d", var--, ++var, --var); 

execution takes place in the C programming language.

+1
source share
1 answer

This behavior is undefined because it varchanges several times without a sequence point between them. The sequence point will be, for example, a ;. However, the commas in the parameter lists do not enter a sequence point, and the order in which the operands are evaluated is undefined (you can say that the code is doubly undefined ...).

+8
source

All Articles