1.

Can I Allocate A Variable Length Character String?

Answer»

YES, in FORTRAN 2003. Declare the variable and allocate with a given length as follows:

character(LEN=:), ALLOCATABLE :: str integer :: N n = 27 allocate(character(LEN=n) :: str)

A Fortran 95 solution is the iso_varying_string module, or the variable length string module in FLIBS.

Yes, in Fortran 2003. Declare the variable and allocate with a given length as follows:

A Fortran 95 solution is the iso_varying_string module, or the variable length string module in FLIBS.



Discussion

No Comment Found