Pointer to array allocation

0ffh spam at frankhirsch.net
Tue Jun 19 13:21:53 PDT 2007


BCS wrote:
> Myron wrote:
>> I'm curious as to the reason for a pointer to a dynamic array instead
>> of a pointer to the array? How do you use the Lst* and what does it
>> allow you to do that the pointer to the array cannot.
> I have done this befor
 > [...]

In my particular case the reason is a union where all alternatives take
4 bytes but for the array, which takes 8. As I expect *lots* of instances
of this union - and only a small part being of the array case - I wanted
to avoid the waste of good memory... :)

Regards, Frank





More information about the Digitalmars-d-learn mailing list