Software Archive
Read-only legacy content
17060 Discussions

Passing strings in C-Fortran mixed language programming

marcellocattaneo
Beginner
875 Views
Is it possible to pass string arguments from a C calling program to a Fortran subroutine without adding the hidden length argument?

By reading the documentation it would seem that giving the REFERENCE attribute to the string argument, it should be possible, but I haven't been able to make it work.

I would appreciate any example of how this works.

regards, Marcello Cattaneo
0 Kudos
1 Reply
Jugoslav_Dujic
Valued Contributor II
875 Views
See here. The point is that you mustn't specify (LEN=*) in the callee but a specified number (a hard-coded constant or a dummy argument).
0 Kudos
Reply