On 10/25/22 2:03 PM, Ali Çehreli wrote:
>On 10/25/22 11:01, Ali Çehreli wrote:
>static arrays don't have .ptr to point
to any member.
Why do I say incorrect things like that? :) Of course static arrays have .ptr as well but that always point to their own body of N elements. They own their elements... I move away from the keyboard now... :)
You were right actually. The arr.ptr
is a shortcut for the address of the first element.
A dynamic array is equivalent to a struct with a ptr
and length
fields. A static array does not have fields, it's just the data itself. The properties are not real fields, but lowerings so they can be used like dynamic arrays.
-Steve