Although FORTRAN and C use different methods for representing global data, it is actually very easy to mix them. If a VAX FORTRAN common block contains a single variable or array, then the corresponding VAX C variable simply needs to be declared as extern and the two variables will use the same storage.
CHARACTER*(10) STRING COMMON /BLOCK/ STRING
C external variable:
extern char block[10];
Note that the name of the C variable corresponds to the name of the FORTRAN common block, not the name of the FORTRAN variable. This example shows that you can use the same storage area for both VAX FORTRAN and VAX C strings. However, you must still beware of the different way in which FORTRAN and C handle the end of a string.
If the FORTRAN common block contains more than one variable or array, then the C variables must be contained in a structure.
If you wish to access the VAX FORTRAN blank common block, then the corresponding VAX C structure should be called $BLANK.
INTEGER I,J,K COMMON /NUMS/ I,J,K
C external variable:
extern struct { int i,j,k; } nums;
CNF and F77 Mixed Language Programming -- FORTRAN and C