【发布时间】:2014-04-14 11:13:18
【问题描述】:
我的问题是,“select type 块可以用来区分 real :: realInput 和 real :: realArrayInput(:) 吗?”很清楚 select type 如何用于区分派生类型,但我不太清楚它如何(或是否)可用于内在类型。
在Mad Libs表格中,是否可以在下面填空以区分上面的输入:
select type (input)
type is (real)
print *, "I caught the realInput"
type is (___________)
print *, "I caught the realArrayInput"
end select
我发现一些相关帖子并没有完全包含我所希望的答案:
【问题讨论】:
-
也许您可以通过将变量传递给
elemental过程,或者为两个过程编写通用接口来实现您的目标。 -
你能用
rank内在函数检查排名吗?
标签: oop polymorphism fortran