"C How to Program 6th edition - page 119" says that the associativity of ++ operator is "right to left". I wonder what does this mean, because ++ is a unary operator so in what case I may experience the associativity of a unary operator? Can you give me an example?
On the other hand, some net resources give different associativity for ++ operator based on its state (being prefix or postfix). While the book gives "right to left" associativity for postfix and prefix together, so which one is correct?
I will thanks full if you give me an example about ? associativity as well.
Thanks and regards
The associativity is only relevant when you have more than one operator applied to an argument. All the operators in group 3 share the same priority, if you happen to apply more than one operator from that group to an argument, they will be resolve according to the associativity rule of that group (right to left in that case).
~++x != ++~x
++ is indeed LTR in suffix and RTL in prefix position.