6
以下犯規編譯英特爾Fortran XE 2011:過程指針,派生類型
TYPE type1
procedure(interface1),POINTER::p
END TYPE type1
ABSTRACT INTERFACE
integer function interface1(a)
real,intent(in)::a
END function interface1
END INTERFACE
錯誤:
error #8262: The passed-object dummy argument must be dummy data object with the same declared type as the type being defined.
謝謝!你介意解釋,爲什麼這解決了我的問題? – 2011-03-31 18:12:05
沒有明確指定'nopass'屬性,組件自動具有'pass'屬性(也可以明確指定)。這意味着過程的第一個僞參數應該與被定義的類型具有相同的類型(如錯誤消息中所述)。當引用procpointer組件時,通過它調用的對象會自動作爲第一個參數傳遞。 – eriktous 2011-03-31 18:21:13
如果我想使用'pass'關鍵字,我將如何更改'interface1'? – 2011-05-04 10:46:13