Unmanaged types (C# reference)

An unmanaged type is any type that isn't a reference type or constructed type (a type that includes at least one type argument), and doesn't contain reference type or constructed type fields at any level of nesting. In other words, an unmanaged type is one of the following:

  • 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 is not a constructed type and contains fields of unmanaged types only

Beginning with C# 7.3, you can use the unmanaged constraint to specify that a type parameter is a non-pointer unmanaged type.

C# language specification

For more information, see the Pointer types section of the C# language specification.

See also