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

ID 767251
Date 11/07/2023
Public

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

Document Table of Contents

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.

Module

USE, INTRINSIC :: ISO_C_BINDING

Syntax

result = C_SIZEOF(x)

x

(Input) Is an interoperable data entity of any type and any rank. It must not be an assumed-size array or an assumed-rank array associated with 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