Click or drag to resize
MarshalSizeOf Method (Type)
Returns the size of an unmanaged type in bytes.

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static int SizeOf(
	Type t
)

Parameters

t
Type: SystemType
The type whose size is to be returned.

Return Value

Type: Int32
The size of the specified type in unmanaged code.
Exceptions
ExceptionCondition
ArgumentExceptionThe t parameter is a generic type.
ArgumentNullExceptionThe t parameter is null.
See Also