0
假設我有以下設置可以是一個類型的成員是一個目標?
type BarType
integer :: i
end type
type FooType
type(BarType) :: bar
end type
我想有另一種類型的
type BazType
type(BarType), pointer :: barPtr
end type
,並設置barPtr
指向foo%bar
。要做到這一點,我將不得不聲明type(BarType), target :: bar
,但我得到了一個錯誤。我沒有進一步調查,並決定改變策略,但只是爲了好奇,你知道這是否允許嗎?