HP C Programmer's Guide (92434-90009)

Chapter 3 55
Calling Other Languages
Comparing HP C and HP FORTRAN 77
Notes on HP C and HP FORTRAN 77
1. The following HP C structure is equivalent to the HP FORTRAN 77 type listed in the
table:
struct complex {
float real_part;
float imag_part;
};
2. The following HP C structure is equivalent to the HP FORTRAN 77 type listed in the
table:
struct double_complex {
double real_part;
double imag_part;
};
string (char *) CHARACTER*n (See
Note 3)
char array CHARACTER*1 array
(See Notes 4 &5)
(See Note 5) Hollerith array
arrays Size is number of
elements times
element size.
Aligned according
to element type.
(See Note 4) Size is number of
elements times element
size. Aligned according to
element type.
struct (See Note 6) STRUCTURE Used to declare
FORTRAN 77 record
structures.
union (See Note 6) UNION Used to declare
FORTRAN 77 union
types.
short (Used for
logical test)
2 bytes, 2-byte
aligned
LOGICAL*2 (See Note
7)
2 bytes, 2-byte aligned
int (Used for logical
test)
4 bytes, 4-byte
aligned
LOGICAL*4 (See Note
7)
4 bytes, 4-byte aligned
void - Used when calling a
SUBROUTINE
function Used when calling a
FUNCTION
Table 3-2. HP C versus HP FORTRAN 77 Storage
HP C Type HP C Description HP FORTRAN 77 Type HP FORTRAN 77
Description