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

Biotronic via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 16 06:41:29 PDT 2017


On Wednesday, 16 August 2017 at 12:50:07 UTC, Suliman wrote:
>> 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?

I'm sorry, I don't understand what you're asking. Can you please 
repeat with more information?

--
   Biotronic


More information about the Digitalmars-d-learn mailing list