[Implemented] Arrays of any size inside structs
Posted: Mon Apr 25, 2005 2:59 pm
some api calls fill structures with a pointer to an array of variable size, so being able to do this would be useful
or being able to declare arrays of any dimension from memory blocks anywhere in the code
Code: Select all
assuming the array is of longs
structure st
*a.LONG[]
endstructure
then you pick up values,
var.st
x = var\a[100]\l
now you have to declare a structure with an array pointer larger enough, without really knowing how big can be the array
structure ALONG
el.LONG[500]
endstructure
structure st
*a.ALONG
endstructure
x = var\a\el[100]\l
Code: Select all
*a.SOMESTRUCT[10, 10] = allocatememory(sizeof(SOMESTRUCT)*100)