Page 1 of 1

About arrays pointers in structures

Posted: Tue Jul 05, 2005 6:44 pm
by Justin
If i do this,

Code: Select all

structure STRUCT
  *arr.l[100]
endstructure 

var.STRUCT
does PB allocate 400 bytes for var or just the 4 bytes of the arr pointer?

Posted: Tue Jul 05, 2005 7:10 pm
by Justin
sizeof() answered the question, just wanted to fake arrays,

Code: Select all

Structure ATEST
	el.l[100]
EndStructure

*a.ATEST = allocatememory(sizeof(LONG)*10)

*a\el[0] = 3

Debug *a\el[0]
so *a is only 4 bytes