Any of the following types may be a pointer type:
- sbyte, byte, short, ushort, int, uint, long, ulong, char, float, double, decimal, or bool.
- Any enum type.
- Any pointer type.
- Any user-defined struct type that contains fields of unmanaged types only.
Pointer types do not inherit from object and no conversions exist between pointer types and object. Also, boxing and unboxing do not support pointers. However, you can convert between different pointer types and between pointer types and integral types.
When you declare multiple pointers in the same declaration, the asterisk (*) is written together with the underlying type only; it is not used as a prefix to each pointer name. For example:
int* p1, p2, p3; // Ok
int *p1, *p2, *p3; // Invalid in C#
A pointer cannot point to a reference or to a struct that contains references, because an object reference can be garbage collected even if a pointer is pointing to it. The garbage collector does not keep track of whether an object is being pointed to by any pointer types.
The value of the pointer variable of type myType* is the address of a variable of type myType.