Slicing to convert pointers to bound arrays

div0 div0 at sourceforge.net
Sat Aug 7 07:48:56 PDT 2010


On 07/08/2010 13:45, simendsjo wrote:
>
> When I do the same with a static array, I get 0. But this is just
> actually garbage, right? It might contain other data, and not always 0?

Yes. It's entirely undefined what will happen, you might find that the 
extra bit of memory you try and access is a non readable page which will 
give you a seg fault or it could be any random chunk of data depending 
on how the executable gets linked.

-- 
My enormous talent is exceeded only by my outrageous laziness.
http://www.ssTk.co.uk


More information about the Digitalmars-d-learn mailing list