About arrays pointers in structures

Everything else that doesn't fall into one of the other PB categories.
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

About arrays pointers in structures

Post 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?
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

Post 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
Post Reply