#include <stdio.h>
/ Use of a COMMON Block from Fortran /
/ This is the layout of the common block in Fortran : /
typedef struct {
int i ; float r ;
} comv ;
/ Function prototypes for Fortran wrapper routines /
void init_name_c ( ) ;
void mc ( )
{
comv p ;
/ Get address of common block from Fortran code./
init_name_c(&p ) ;
printf ( "C gets Common block /com/ : %4d%6.2 f \n" ,p->i , p->r ) ;
/ Change the values in the common block./
p->i = 457;
p->r = 17.5 ;
printf ( "C gives Common block /com/ : %4d%6.2 f \n" ,p->i , p->r ) ;
}