There is a simple correspondence between Sun FORTRAN and C numeric variable types. The standard types are given in the upper part of the table below, and non-standard extensions in the lower part. These should generally be avoided for reasons of portability, however, they are provided since HDS has corresponding data types.
Although C defines unsigned data types of unsigned char (range 0 to 255), unsigned short (range 0 to 32767) and unsigned int (range 0 to 232-1), there are no corresponding unsigned data types in FORTRAN. There is also a C type called long int, however on Suns, this is the same as an int.
The C language does not specify whether variables of type char should be stored as signed or unsigned values. On Suns, they are stored as signed values in the range -128 to 127.
Similarly there is no C data type that corresponds to the FORTRAN data type of COMPLEX. However, since Sun FORTRAN passes all numeric variable by reference, a COMPLEX variable could be passed to a C subprogram where it might be handled as a structure consisting of two variables of type float.
A Sun FORTRAN LOGICAL value can be passed to a C int. Sun FORTRAN and C both use zero to represent a false value and anything else to represent a true value, so there is no problem with converting the data values.
CNF and F77 Mixed Language Programming -- FORTRAN and C