Previous: sfor2len Up: Fortran String Conversion Routines


ptr = sfor2ptr(for_string);

This routine returns a pointer to the actual characters in an input Fortran string. It does not get the Fortran string length, nor does it copy the string to an output C string. It merely returns a pointer to the characters. No guarantee is made that any of the characters are valid, since that depends on the Fortran string length. You can be sure that there will not be a null terminator. Some machines may have one, but you may not depend on a null terminator being there.

Note that only the FOR_STRING standard argument is required. This is because the Fortran string length is ignored. All the other parameters are used to find the length.