Pointer to array allocation

0ffh spam at frankhirsch.net
Mon Jun 18 10:47:19 PDT 2007


Thanks for the answers!

Derek Parnell wrote:
 > struct LD
 > {
 >   Lst da;
 > }

Thanks for the suggestion!
Been thinking about the same thing, but it's a bit unwieldy:
You'd have to write bar.da[baz] all the time instead of just bar[baz].

BCS wrote:
 > void test()
 > {
 >   Lst *l=(new Lst[1]).ptr;
 > }

That looks a much less hacky than what I did, all but neat... cool! :)

@Myron: Thanks, too!

Regards, Frank


More information about the Digitalmars-d-learn mailing list