Get object address when creating it in for loop

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Mon May 5 09:21:50 PDT 2014


On Monday, 5 May 2014 at 16:15:43 UTC, hardcoremore wrote:
> 	neurons[] = &n; // here &n always returns same adress

You're taking the address of the pointer, which isn't changing. 
Just use plain n - when you new it, it is already a pointer so 
just add that value to your array.


More information about the Digitalmars-d mailing list