Указатель на функцию в фортране
|
|
Пятница, 02 Октября 2015 г. 15:29
+ в цитатник
module module_act
implicit none
contains
integer function act(f, a, b)
implicit none
integer, intent(in) :: a, b
interface
integer function f(x, y)
integer, intent(in) :: x, y
end function f
end interface
act = f(a, b)
end function act
end module module_act
program pr
use module_act
implicit none
interface
integer function add(a, b)
integer, intent(in) :: a, b
end function add
end interface
print *, "res = ", act(add, 1, 2)
end program pr
integer function add(a, b)
implicit none
integer, intent(in) :: a, b
add = a + b
end function add
https://r-aa.livejournal.com/39069.html
Метки:
it
программирование
шпаргалки
fortran
-
Запись понравилась
-
0
Процитировали
-
0
Сохранили
-