Intel® Fortran Compiler 18.0 Developer Guide and Reference

C_SIZEOF

Intrinsic Module Inquiry function (Generic): Returns the number of bytes of storage used by the argument. It cannot be passed as an actual argument nor used in a constant expression.

Module

USE, INTRINSIC :: ISO_C_BINDING

Syntax

result = C_SIZEOF(x)

x

(Input) Is an interoperable data entity of any type. It must not be an assumed-size array.

Results

The result is a scalar of type INTEGER(4) on IA-32 architecture; INTEGER(8) on Intel® 64 architecture. If x is scalar, the result value is the size of x in bytes. If x is an array, the result value is the size of a single element of x multiplied by the number of elements in x.

Example

Consider the following:

INTEGER(4) :: S
INTEGER(4) :: T(3)
C_SIZEOF(S) ! has the value 4
C_SIZEOF(T) ! has the value 12

See Also