Type (struct) declared in Extern issue

BlitzMax Forums/BlitzMax Programming/Type (struct) declared in Extern issue

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

funny... i was looking at some old code and happened upon where i was passing a struct. i defined the parameter in the function i was passing it to as Int and then passed Int(Varptr(field1)) as the parameter where field1 was the first field defined in my type. the caveat is that the function parameter on the C side was a pointer to a struct. so something like:

Type teststruct
   Field fld1:Int
   Field fld2:Float
EndType

Extern
   Function test(structptr:int)
EndExtern

Local testparam:teststruct=New teststruct

test(Int(Varptr(testparam.fld1)))