[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

## 9.257 SizeOf

### Synopsis

    function SizeOf (var x): SizeType;

### Description

Returns the size of a type or variable in bytes.

``SizeOf'` can be applied to expressions and type names. If the argument is a polymorphic object, the size of its actual type is returned.

### Conforming to

``SizeOf'` is a UCSD Pascal extension.

### Example

    program SizeOfDemo;
    var
      a: Integer;
      b: array [1 .. 8] of Char;
    begin
      WriteLn (SizeOf (a));        { Size of an `Integer'; often 4 bytes. }
      WriteLn (SizeOf (Integer));  { The same. }
      WriteLn (SizeOf (b))         { Size of eight `Char's; usually 8 bytes. }
    end.

### See also

section 9.26 BitSizeOf, section 9.5 AlignOf, section 9.286 TypeOf.

This document was generated by Frank Heckenbach on May, 10 2002 using texi2html