If structures places data to stack why we do not getting stackoverflow on array of structures?

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 16 05:50:07 PDT 2017


> MyStruct[] is actually a struct similar to this:
>
> struct MyStruct[] {
>     MyStruct* ptr;
>     size_t length;
> }
>
> That struct is placed on the stack, but the data it points to, 
> via the ptr field, is heap allocated.

What is struct? Just name and size?



More information about the Digitalmars-d-learn mailing list