All operators in C++ perform some defined function. This table shows the operator, precedence (which determines who goes first), cardinality, and associativity in the C++ program.
| Operator | Cardinality | Associativity | |
|---|---|---|---|
| Highest precedence | () [] -> . | unary | left to right |
| ! ~ + - ++ — & * (cast) sizeof | unary | left to right | |
| * / % | binary | left to right | |
| + - | binary | left to right | |
| << >> | binary | left to right | |
| < <= > >= | binary | left to right | |
| == != | binary | left to right | |
| & | binary | left to right | |
| ^ | binary | left to right | |
| | | binary | left to right | |
| && | binary | left to right | |
| || | binary | left to right | |
| ?: | ternary | right to left | |
| = *= /= %= += -= &= ^= |= <<= >>= | binary | right to left | |
| Lowest precedence | , | binary | left to right |
dummies
Source:http://www.dummies.com/how-to/content/operators-in-c-programming.html
No comments:
Post a Comment