Classes new'd inside for loop are all the same instance?

lobo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Sep 8 05:39:34 PDT 2016


On Thursday, 8 September 2016 at 12:36:29 UTC, drug wrote:
> 08.09.2016 15:24, lobo пишет:
>>[...]
> &c is address of the variable c, that is allocated on the stack 
> and has the same address on every iteration
> cast(void*)c return the value of variable c that is address of 
> a class instance and is different for every iteration
>
> in other words
> &c is address of pointer
> cast(void*)c is the pointer itself

Got it, thank you :)


More information about the Digitalmars-d-learn mailing list