Fortran and C support many of the same data types, but there are no direct correlations.
One difference is that Fortran has the concept of kinds. C treats these kinds as distinct types. For example, the Fortran INTEGER. C has integer types that range from short int to long long int, and has specialty types such as intptr_t. Fortran may not have a corresponding kind. For each interoperable C integer type, the ISO_C_BINDING declares a named constant (PARAMETER) that gives the kind number for the implementation's equivalent INTEGER kind.
Consider the simple C int type. This corresponds to INTEGER(C_INT), where C_INT is defined in the ISO_C_BINDING. In Intel® Fortran, the value is always four, as a C int corresponds with Fortran INTEGER(4). Other Fortran implementations may use different kind numbers. Using the named constant ensures portability.
Now consider the C intptr_t type. This integer is large enough to hold a pointer (address). In Intel® Fortran, this corresponds to INTEGER(C_INTPTR_T). It is INTEGER(4) when building a 32-bit application, and INTEGER(8) when building a 64-bit application.
Fortran has no unsigned integer types, so there are no constants for C unsigned types. These types are not interoperable.
If there is a kind of C type that is not supported by the Fortran implementation, the named constant for that type is defined as -1 and generates a compile-time error if used.
There are constants defined for REAL, COMPLEX, LOGICAL, and CHARACTER. For REAL, the standard offers the possibility of a C long double type. This is implemented in different ways by various C compilers on various platforms supported by Intel® Fortran.
For Intel's DPC++ and C/C++ compilers, long double by default is an 80-bit extended precision floating-point type. C/C++ files containing long double data types that interoperate with Fortran should be compiled with the GCC option -mlong-double-128 to force long double variables to 128-bit quad precision. Intel's Fortran compilers do not support an 80-bit extended precision data type.
LOGICAL and CHARACTER need special treatment for interoperability. The Fortran standard states that LOGICAL corresponds to the (ISO_C_BINDING) C _Bool type, and defines a single kind value of C_BOOL, which is 1 in Intel® Fortran. By default, Intel® Fortran, tests LOGICALs for true/false differently than C does. Where C uses zero for false and not-zero for true, Intel® Fortran defaults to using -1 (all bits set) as true and zero as false. If you are going to use LOGICAL types to interoperate with C, specify the option fpscomp[:]logicals to change the interpretation to be C-like. This is included when using the option standard-semantics, which is recommended for using Fortran 2003 (or later) features. C does not have character strings. It has arrays of single characters, and this is how strings in Fortran must be represented. There is a kind value defined as C_CHAR, which corresponds to the C char type. Only character variables with a length of one are interoperable. See Procedures for more information.
Derived types can also be interoperable. For additional information and restrictions, see Derived Types.