fortran程序 第一次接触fortran语言,试着编写了一个简单的程序:program tsimplicit non
fortran程序
第一次接触fortran语言,试着编写了一个简单的程序:
program ts
implicit none
integer x
x=120
call ti(x)
end
subroutine ti(x)
real*8 x
i=x
print *,'i=',x
end
连接时会有警告:Warning:In the call to TI,actual argument #1 does not match the type and kind of the corresponding dummy argument.call ti(x)
但当我把所有的i和x交换,其他不变,就没有问题,能够的到正确的结果.
为什么fortran不能学C那样在形参前面加一个integer 就好?应该怎么改呢?