今天看到一个有关枚举类型的用法 
 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode   enum,bind(C) :: num
     enumerator :: zero=0,one,two,three
  end enum
  type(num) :: mynum=one 
但我的gfortran8认为这是有问题的语法。 
换成下面的办法可行: 
[Fortran] syntaxhighlighter_viewsource syntaxhighlighter_copycode   enum,bind(C)
     enumerator :: zero,one,two,three
  end enum
  integer :: a=two
  print*,a
 
无法限定类名,这样的使用方法岂不是很鸡肋。 
 |