Supported data types between C++ and Fortran

Table 1 lists the data types that can be passed between C++ and Fortran by reference.

Table 1. Supported data types passed by reference
C++ Fortran
signed short int INTEGER*2
signed int, signed long int INTEGER*4
float REAL*4
double REAL*8
long double REAL*16
signed char INTEGER*1
unsigned char UNSIGNED*1 or CHARACTER*1
char[n] CHARACTER*n
Address of supported data types and aggregates

Examples:
Address of an integer
(...int**...)

Address of an array of integers
(...int(**)[8]...)

 


POINTER (X,Y)
INTEGER*4 Y

POINTER (X,Y)
INTEGER*4 Y(8)