<div>2012/2/28 Pedro Lacerda <span dir="ltr"><<a href="mailto:pslacerda@gmail.com">pslacerda@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
So are a newly allocated array and a null one just the same thing?<div><br></div><div><div>    int[] a = [], b = null;</div><div>    assert(a == b);</div><div>    assert(a.length == b.length);</div><div>    assert(a.ptr == a.ptr);</div>
<br class="Apple-interchange-newline"></div></blockquote></div><div><br></div>Hi all,<div><br></div><div>Sorry if this is a stupid question - I'm new to D but I've been keeping an eye on it for quite a while (and also read the book).</div>
<div><br></div><div>Coming from the Java/C# world, not distinguishing between an empty array and null feels strange to me. Is this so for strings as well? ...and in Pedros example, if you assign null to b and then try to access b.length, don't you get a NullPointerException? What am I missing?</div>
<div><br><br></div><div>/ Mikael</div>