Next: , Previous: C Interfacing Tools, Up: Interoperating with C and C++


12.1.2 Accessing Type Information in C

Generally, C code written to link with g77 code—calling and/or being called from Fortran—should `#include <g2c.h>' to define the C versions of the Fortran types. Don't assume Fortran INTEGER types correspond to C ints, for instance; instead, declare them as integer, a type defined by g2c.h. g2c.h is installed where gcc will find it by default, assuming you use a copy of gcc compatible with g77, probably built at the same time as g77.