null and type safety

Walter Bright newshound1 at digitalmars.com
Tue Nov 4 16:13:56 PST 2008


cemiller wrote:
> null pointers DO cause memory corruption:
> 
>    byte* foo = null;   // NULL!
>    foo[1244916] = 5;   // WORKS; CORRUPTS!

Yes, but so will any pointer that you index out of bounds. That's why 
safe D will not allow arithmetic on pointers.



More information about the Digitalmars-d mailing list