fortran调用mysql_Fortran过程

过程是一组执行一个明确定义的任务,可以从程序调用语句。信息(或数据)被传递给调用程序,以过程作为参数。

有两种类型的程序:

函数

子程序

函数

函数是返回一个数量的过程。函数不修改其参数。

返回数值被称为函数值,并将其表示为函数名。

语法:

函数的语法如下:

function name(arg1, arg2, ....)

[declarations, including those for the arguments]

[executable statements]

end function [name]

下面的示例演示一个函数名为area_of_circle。它计算半径为 r 的圆的面积。

program calling_func

real :: a

a = area_of_circle(2.0)

Print *, "The area of a circle with radius 2.0 is"

Print *, a

end program calling_func

! this function computes the area of a circle with radius r

function area_of_circle (r)

! function result

implicit none

! dummy arguments

real :: area_of_circle

! local variables

real :: r

real :: pi

pi =

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值