Weird struct sizeof with static arrays
Posted: Fri May 17, 2024 11:14 am
PB6.11 b2
Why sizeof returns 0?, should't be the pointer size?
With this behaviour is not possible to do this:
Could this be changed for the next version?
Why sizeof returns 0?, should't be the pointer size?
With this behaviour is not possible to do this:
Code: Select all
Structure MYSTRUCT
*arr.RECT[0]
EndStructure
Define.MYSTRUCT *st
Debug SizeOf(MYSTRUCT) ;0 ??
*st = AllocateMemory(SizeOf(MYSTRUCT)) ;ERROR
;Not possible
*st\arr = AllocateMemory(SizeOf(RECT) * 4)
*st\arr[2]\left = 10