is this the expected output

spir denis.spir at gmail.com
Wed Dec 22 16:52:23 PST 2010


On Wed, 22 Dec 2010 19:40:16 -0500
g g <htpp at www.com> wrote:

> Thanks for the answers
> what I did is this ( i feel that it is quite clumsy):
> 
>        Node* x = cast(Node*) (GC.malloc(Node.sizeof));
>         *x = xa;
>         x.up = curnode;
>         ...

This is not that clumsy (except for you naming!). You have to allocate distinct memory cells for distinct programming elements that represent distinct entities in your (mental) modell, haven't you? D provides adequate features that allow you thinking thinking at a higher-level. But if you want to play at a lower-level, you'll need to juggle with pointer detail issues ;-)

Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list