Start here · Essential guide
Unary Operators in C++
Learn what unary operators in C++ are, from the one-operand symbols like !, ~, ++ and * to prefix vs postfix, precedence and common mistakes, with examples.
Syntax and Functions
The operators that act on a single operand and how they differ from ternary ones.
Start here · Essential guide
Learn what unary operators in C++ are, from the one-operand symbols like !, ~, ++ and * to prefix vs postfix, precedence and common mistakes, with examples.
Learn the difference between unary and ternary operators in C++. A unary operator takes one operand and a ternary operator takes three, as in ?:.
The only logical operator in C++ that is unary is the logical NOT, !. Learn why && and || need two operands, with a short example and a quick comparison.
Related topics