Re: Pointers to functions: Is this the right [f03] syntax?
- From: "Andy" <andyv@xxxxxxxxxxxxxx>
- Date: 21 Jun 2006 19:40:20 -0700
Richard E Maine wrote:
Andy <andyv@xxxxxxxxxxxxxx> wrote:
I've made a couple fixes and the current g95 can compile and run this
code fine now. I am worried that things may be a little too loose in
that the pointer p in the original code points to a subroutine, then
later on a function,
I don't see that in the code posted here, though I suppose it might be
so in the prior posting to gg95 (I don't often read that group).
It looked something like:
module m
contains
subroutine sub
print *, 'in sub'
end subroutine sub
function func()
func = 1.0
end function func
end module m
use m
procedure (), pointer :: p
p => sub
call p()
p => func
print *, p()
end
.
- Follow-Ups:
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Richard Maine
- Re: Pointers to functions: Is this the right [f03] syntax?
- References:
- Pointers to functions: Is this the right [f03] syntax?
- From: Pere
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Richard E Maine
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Andy
- Re: Pointers to functions: Is this the right [f03] syntax?
- From: Richard E Maine
- Pointers to functions: Is this the right [f03] syntax?
- Prev by Date: Re: help for reading a binary file
- Next by Date: Re: Pointers to functions: Is this the right [f03] syntax?
- Previous by thread: Re: Pointers to functions: Is this the right [f03] syntax?
- Next by thread: Re: Pointers to functions: Is this the right [f03] syntax?
- Index(es):
Relevant Pages
|