Pointer conversions are performed when pointers are used, including pointer assignment, initialization, and comparison.
Conversions that involve pointers must use an explicit type cast. The exceptions to this rule are the allowable assignment conversions for C pointers. In the following table, a const-qualified lvalue cannot be used as a left operand of the assignment.
Left operand type | Permitted right operand types |
---|---|
pointer to (object) T |
|
pointer to (function) F |
|
The referenced type of the left operand must have the same qualifiers as the right operand. An object pointer may be an incomplete type if the other pointer has type void*.
An lvalue that is a function can be converted to an rvalue that is a pointer to a function of the same type, except when the expression is used as the operand of the & (address) operator, the () (function call) operator, or the sizeof operator.
Related information