[comp.lang.fortran] VAX - passing strings between C and FORTRAN

springer@khonshu.Colorado.EDU (Jann Springer) (02/06/91)

To transfer a character string between C and Fortran involves
using a descriptor, which is how Fortran passes character strings.
When calling a C routine from Fortran, the argument associated
with the character string is the address of a descriptor. The
descriptor contains the address of the first character of the
string, the length of the string, and a few other items. Having
the length of the string and the address of the first character
allows you to use it in C. To pass the result back to Fortran, you
have to put the length and the first character address into the
descriptor. 

If you would like an example, e-mail me a message and I will
invent something and mail it back.

This explanation assumes you are using VMS and not Ultrix.

Good luck.

Jann Springer
springer@khonshu.colorado.edu