RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.SizeOf Function

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

Pascal
function SizeOf(X): Integer;
C++
int SizeOf( X);

System

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. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!