|
Post by Darkjester on Jan 6, 2015 19:29:41 GMT -5
Is there a way to return a pointer to a structure from a function? It seems the method that i thought would work always results in incorrect data type.
I was trying
Function obj(structure &struc) Dim &pntr Pntr = struc Return pntr End function
What am i missing?
|
|
|
Post by DJLinux on Jan 31, 2015 20:40:25 GMT -5
do you mean allocation of pointer on struct?type TEST i as integer f as single ia(2) as integer fa(3) as single end type
function &AllocPointer() as TEST dim &pNew as TEST alloc pNew return &pNew end function
dim &thing as TEST &thing = AllocPointer() or do you mean something like this?type TEST i as integer f as single ia(2) as integer fa(3) as single end type
function &ReturnPointer(&from as TEST) as TEST return &from end function
dim from as test dim &this as TEST &this = ReturnPointer(from)
|
|