System.SizeOf

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function SizeOf(var X): Integer;

Properties

Type Visibility Source Unit Parent
function public System.pas System System

Description

Returns the number of bytes occupied by a variable or type.

Pass a Delphi variable reference to SizeOf to determine the number of bytes used to represent the variable. Pass a type identifier to SizeOf to determine the number of bytes used to represent instances of that type. SizeOf is useful for determining the amount of memory to specify for the FillChar, Move, or GetMem procedures.

SizeOf returns 0 when the argument is an untyped variable.

See Also

Code Examples