! gcc -c csub.c ! F csub.o f_calls_c.f95 ! ./a.out ! The value of i is 42 ! The value of d is 4.200000 ! The value of a[3] is 3.300000 ! The value of c is abc program f_calls_c integer, parameter :: n = 42 integer, parameter :: double = selected_real_kind(9) real(kind=double), pointer :: dp integer :: i real, dimension(0:9) :: ra = ( (/ (1.1*i, i=0,9) /) ) character(len=3) :: s = "abc" allocate (dp) dp = 4.2_double call csub (s) end program f_calls_c ! file csub.c: ! void csub_ (int *i, double *d, float a[], char *c) { ! ! printf("The value of i is %d\n", *i); ! printf("The value of d is %f\n", *d); ! printf("The value of a[3] is %f\n", a[3]); ! printf("The value of c is %s\n", c); ! ! }