The files mixed-c.c
and mixed-f.f
illustrate some of
the techniques involved in calling C from Fortran and vice
versa, as described in Section 2.5.4.
On a Sun, compile and link them as follows:
The extra option to the firstf77 -c mixed-f.f -ext_names=plain cc -c mixed-c.c f77 -o mixed mixed-c.o mixed-f.o
f77
command
tells the compiler not to add an underscore to function
names; different compilers will have different switches
for accomplishing the same thing. See Section 2.5.4.3 for discussion.