Force struct allocation on the heap?

Benji Smith dlanguage at benjismith.net
Sun Oct 19 08:09:57 PDT 2008


Lars Kyllingstad wrote:
> You allocate a struct on the heap using the "new" keyword.
> 
>   struct Foo { ... }
>   Foo* foo = new Foo;
> 
> Note that "new" returns a pointer for non-object types.


Perfect. Thanks!

--benji


More information about the Digitalmars-d-learn mailing list