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 00:39:01 PDT 2017


> On the heap, unless you are allocating it via e.g. alloca.

If
struct MyStruct
{
  int x;
  int y;
}

MyStruct mystruct;

is located on stack, why:

MyStruct [] mystructs;

should located on heap?


More information about the Digitalmars-d-learn mailing list