Hi,
I am trying to send a derived data type , which has a derived data type as a member, to a 'C' function. However from the C function trying to access to access the derived type member results in a segmentation fault. For more context here is the little snippet of code..
TYPE :: TEST
SEQUENCE
INTEGER :: x, y, z
END TYPE TEST
TYPE :: point
SEQUENCE
INTEGER :: x, y, z
integer, dimension), allocatable :: node
type(TEST) , allocatable :: testvar)
END TYPE point
Now I declare an object of type 'point' and allocate memory for the variables as..
TYPE (point) base
ALLOCATE(base%node(4))
ALLOCATE(base%testvar(5))
and pass 'base' to a C function. I can access the equivalent of 'base%x' and 'base%node' from C , however trying to access 'testvar' results in a segmentation fault. I am missing something here...Any help would be appreciated...
Thanks,
Sj
I am trying to send a derived data type , which has a derived data type as a member, to a 'C' function. However from the C function trying to access to access the derived type member results in a segmentation fault. For more context here is the little snippet of code..
TYPE :: TEST
SEQUENCE
INTEGER :: x, y, z
END TYPE TEST
TYPE :: point
SEQUENCE
INTEGER :: x, y, z
integer, dimension), allocatable :: node
type(TEST) , allocatable :: testvar)
END TYPE point
Now I declare an object of type 'point' and allocate memory for the variables as..
TYPE (point) base
ALLOCATE(base%node(4))
ALLOCATE(base%testvar(5))
and pass 'base' to a C function. I can access the equivalent of 'base%x' and 'base%node' from C , however trying to access 'testvar' results in a segmentation fault. I am missing something here...Any help would be appreciated...
Thanks,
Sj