Punctuators and operators
A punctuator is a token that has syntactic and semantic meaning to the compiler, but the exact significance depends on the context. A punctuator can also be a token that is used in the syntax of the preprocessor.
C99 and C++ define the following tokens as punctuators, operators, or preprocessing tokens:
Table 1. C and C++ punctuators
[ ] | ( ) | { } | , | : | ; |
* | = | … | # | ||
. | -> | ++ | -- | ## | |
& | + | - | ~ | ! | |
⁄ | % | << | >> | != | |
< | > | <= | >= | == | |
^ | | | && | || | ? | |
*= | ⁄= | %= | += | -= | |
<<= | >>= | &= | ^= | |= |
Beginning of C++ only.
In addition to the C99 preprocessing tokens, operators, and punctuators, C++ allows the following tokens as punctuators:
Table2.C++ punctuators
:: | .* | ->* | new | delete | |
and | and_eq | bitand | bitor | comp | |
not | not_eq | or | or_eq | xor | xor_eq |
End of C++ only.
Related information