Intel® Fortran Compiler Classic and Intel® Fortran Compiler Developer Guide and Reference

ID 767251
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

SIZEOF

Inquiry Intrinsic Function (Generic): Returns the number of bytes of storage used by the argument. It cannot be passed as an actual argument.

result = SIZEOF (x)

x

(Input) Can be a scalar or array. It may be of any data type. It must not be an assumed-size array. If it is an assumed-rank array, it must not be associated with an assumed-size array. If it is type CHARACTER, it cannot be a dummy argument with LEN=*.

Results

The result type is INTEGER(4) on IA-32 architecture; INTEGER(8) on Intel® 64 architecture. The result value is the number of bytes of storage used by x.

If x is of derived type, the result includes storage used by padding and descriptors for pointer or allocatable components, if any, but not the storage used for the data of pointer or allocatable components. If x is an assumed-rank array associated with an assumed-size array, the result is undefined.

Example

SIZEOF (3.44)              ! has the value 4

SIZEOF ('SIZE')            ! has the value 4

See Also