Disregard the 2;
, it's a statement on its own that doesn't do anything. Then, if we remove the whitespace, we get
+3;
Which is a valid expression. Like how -3;
would also be valid. +3
is the same as 3
. You can read about the unary plus here:
+ expression
unary plus (promotion).
For the built-in operator, expression must
have arithmetic, unscoped enumeration, or pointer type. Integral
promotion is performed on the operand if it has integral or unscoped
enumeration type and determines the type of the result.
*3
, on the other hand, is not meaningful. Unary *
can't be applied to the literal 3
.