why static array can be reassigned with new allocation?
Mike Parker
aldacron at gmail.com
Sun Oct 16 11:50:02 UTC 2022
On Sunday, 16 October 2022 at 11:47:35 UTC, mw wrote:
> On Sunday, 16 October 2022 at 09:04:59 UTC, Nick Treleaven
> wrote:
.
>>
>> A static array doesn't have a ptr runtime field.
>
> Someone showed this code very earlier in this thread already:
>
>
> void main() {
> int[3] arr;
> writeln(arr.ptr);
> }
>
> Output:
> 7FFC1A072820
>
>
Keyword: "runtime". Try to assign a new value to the `.ptr`
property and see what happens.
More information about the Digitalmars-d
mailing list