Arrays of strings in Fortran-C bridges using iso_c_binding
I'm writing code that will call a C function from Fortran using Fortran's C interoperability mechanism (introduced in Fortran 2003 and implemented in newer versions of gfortran and ifort). This answer is almost what I need, but I can't quite get my head around what interface declaration I should use in Fortran for a C function that looks like this: int use_array(int n, char * array[]){ int i; for(i=0; i<n; i++){ printf("Item %d = %s\n",i,array[i]); } return n; } I'm not clear what the declaration should be for the interface on the Fortran end: interface function use_array(n, x) bind(C) use iso