On Tue, 21 Oct 2014 17:25:09 +0300 ketmar via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> On Tue, 21 Oct 2014 13:43:29 +0000 > Solomon E via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> > wrote: > > > `b[0] = 8;` or `b[] = 8;` changes a. Printing the values for &a > > and &b shows they're different pointers, but (a is b) returns > > true. So I still have more to learn about how it does that. > that's 'cause '&b' taking address of hidden "array structure", not > the first array element, as in C. try 'a.ptr' and 'b.ptr' to get > addresses of array elements. p.s. '&(a[0])' and '&(b[0])' works too. parens are just for clarifying.
signature.asc
Description: PGP signature