Download PGI User's Guide

Transcript
Table A-17: Fortran and C/C++ Data Type Compatibility
Fortran Type
C/C++ Type
Size (bytes)
CHARACTER*n x
char x[n]
n
REAL x
float x
4
REAL*4 x
float x
4
REAL*8 x
double x
8
DOUBLE PRECISION x
double x
8
INTEGER x
int x
4
INTEGER*1 x
signed char x
1
INTEGER*2 x
short x
2
INTEGER*4 x
int x
4
INTEGER*8 x
long long x
8
LOGICAL x
int x
4
LOGICAL*1 x
char x
1
LOGICAL*2 x
short x
2
LOGICAL*4 x
int x
4
LOGICAL*8 x
long long x
8
Table A-18: Fortran and C/C++ Representation of the COMPLEX Type
Fortran Type
C/C++ Type
Size (bytes)
COMPLEX x
struct {float r, I;} x;
8
COMPLEX*8 x
struct {float r, I;} x;
8
COMPLEX*16 x
struct {double dr,di;} x;
16
DOUBLE COMPLEX x
struct {double dr,di;} x;
16
Arrays
C/C++ arrays and Fortran arrays use different default initial array index values. By default, C/C++
Run-time Environment
243