[J3] Can a procedure pointer have character(*) result type?
Vipul Parekh
parekhvs at gmail.com
Tue Nov 29 20:26:45 UTC 2022
Oops sorry, Brad, I meant including the POINTER attribute and what NAG
says then. Thanks,
! File p.f90
character(2) :: cc
character(4), external :: foo
interface
subroutine sub(proc, arg)
character(*) :: arg
character(*), intent(in) external, pointer :: proc
end
end interface
cc = "ab"
call sub(foo, cc)
end
! File sub.f90
subroutine sub(proc, arg)
character(*) :: arg
character(*), intent(in), external, pointer :: proc
print*, proc(arg)
end
! File foo.f90
function foo(arg)
character(*) :: foo, arg
foo = arg // "cd"
end function
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20221129/ad44e94d/attachment.htm>
More information about the J3
mailing list