Global const variables

ketmar via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Oct 21 07:25:09 PDT 2014


On Tue, 21 Oct 2014 13:43:29 +0000
Solomon E via Digitalmars-d-learn <digitalmars-d-learn at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20141021/599ea6ac/attachment.sig>


More information about the Digitalmars-d-learn mailing list