This documentation is archived and is not being maintained.

A.5 Pointers in expressions

Visual Studio .NET 2003

In an unsafe context an expression may yield a result of a pointer type, but outside an unsafe context it is a compile-time error for an expression to be of a pointer type. In precise terms, outside an unsafe context a compile-time error occurs if any simple-name (Section 7.5.2), member-access (Section 7.5.4), invocation-expression (Section 7.5.5), or element-access (Section 7.5.6) is of a pointer type.

In an unsafe context, the primary-no-array-creation-expression (Section 7.5) and unary-expression (Section 7.6) productions permit the following additional constructs:

primary-no-array-creation-expression:
...
pointer-member-access
pointer-element-access
sizeof-expression
unary-expression:
...
pointer-indirection-expression
addressof-expression

These constructs are described in the following sections. The precedence and associativity of the unsafe operators is implied by the grammar.

Show: