Memory alignment for strings ifort vs gfortran

It’s probably better. Just a detail, you have to account for the extra null char somewhere, either
f_free_string(c_string, strlen(c_string)+1);
or
CHARACTER(len=len+1), POINTER :: f_string

Also, you should use the kind=c_char for the declaration of what is passed to/from C.

1 Like