What is the purpose of the unary plus (+) operator in C?

You can use it as a sort of assertion that an expression has arithmetic type:

#define CHECK_ARITHMETIC(x) (+(x))

This will generate a compile-time error if x evaluates to (say) a pointer.

That is about the only practical use I can think of.


As per the C90 standard in 6.3.3.3:

The result of the unary + operator is the value of its operand. The integral promotion is performed on the operand. and the result has the promoted type.

and

The operand of the unary + or - operator shall have arithmetic type..