Contents | Prev | Next

7.2.57 The sizeof function

Description

The sizeof function returns the size (in bytes) of it's parameter. The type of the value returned by this function is always word.

Parameter

The sizeof function's only parameter is either a reference to a variable, or a type. If the parameter is a reference to a variable then this function returns the number of bytes occupied by the variable. If the parameter is a type then this function returns the number of bytes occupied by variables of that type.

Example

   sizeof(integer)  returns   4
   sizeof(char)     returns   1
   sizeof(real)     returns   8
   sizeof(boolean)  returns   4

Portability

Operating Systems: All
Standard Pascal: No

Contents | Prev | Next