Other operators
From cppreference.com
A collection of operators that do not fit into any of the other major categories.
| Operator | Operator name | Example | Description |
|---|---|---|---|
| (...) | function call | f(...) | call the function f(), with zero or more arguments |
| , | comma operator | a, b | evaluate expression a, disregard its return value and complete any side-effects, then evaluate expression b, returning the type and the result of this evaluation |
| (type) | type cast | (type)a | cast the type of a to type |
| ? : | conditional operator | a ? b : c | if a is logically true (does not evaluate to zero) then evaluate expression b, otherwise evaluate expression c |
| sizeof | sizeof operator | sizeof a | the size in bytes of a |
| _Alignof (since C11) | _Alignof operator | _Alignof a | the alignment required of the type of a |
[edit] See Also
| Common operators | ||||||
|---|---|---|---|---|---|---|
| assignment | increment decrement |
arithmetic | logical | comparison | member access |
other |
|
a = b |
++a |
+a |
!a |
a == b |
a[b] |
a(...) |