Computer PPSC Updateable
In C++, which operator has the highest precedence?
Show answer
Correct answer: A) Postfix
In the C++ operator precedence table, the postfix operators (postfix ++ and --, function call and subscripting group) sit at the highest level among the given choices, above unary, shift and equality operators. Higher precedence means the operator is evaluated earlier in an expression.
Related facts:
Postfix ++ and -- are applied after the operand's value is used, unlike their prefix forms.
Equality operators (==, !=) have much lower precedence than arithmetic and shift operators.
Exam tip: When precedence levels are confused, use parentheses; examiners often test postfix versus unary order.
Explanation
In the C++ operator precedence table, the postfix operators (postfix ++ and --, function call and subscripting group) sit at the highest level among the given choices, above unary, shift and equality operators. Higher precedence means the operator is evaluated earlier in an expression.
Related facts:
Postfix ++ and -- are applied after the operand's value is used, unlike their prefix forms.
Equality operators (==, !=) have much lower precedence than arithmetic and shift operators.
Exam tip: When precedence levels are confused, use parentheses; examiners often test postfix versus unary order.
This answer may be out of date (last checked December 2015)