This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Is it a bug ?
- From: "Sang Chunlei" <sangchunlei at hotmail dot com>
- To: fortran at gcc dot gnu dot org
- Date: Thu, 27 Jan 2005 17:04:10 +0800
- Subject: Is it a bug ?
- Bcc:
fun_ptr should return the value of ptr, but it return the address ?known
bug ?
program ptr
interface
function fun_ptr(m1,m2)result(ptr)
integer,intent(in)::m1,m2
integer,pointer::ptr
end function fun_ptr
end interface
integer::x, y
integer,target::rm
! read*, x, y
rm=fun_ptr(4,5)
print*,rm
end program ptr
function fun_ptr(m1,m2)result(ptr)
integer,intent(in)::m1,m2
integer,pointer::ptr
allocate(ptr)
if(m1<m2) then
ptr=m1
else
ptr=m2
end if
end function fun_ptr
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com