Pointers - Is it safe to point to invalid memory?

Brother Bill brotherbill at mail.com
Sat Aug 16 11:56:43 UTC 2025


It is obvious that reading or writing to invalid memory can 
result in "undefined behavior".
But is merely pointing to invalid memory "harmful"?

The documentation states that going one past the last element of 
a slice is acceptable.
But is it also safe to go 10, 100 or 1000 items past the last 
element of a slice?


More information about the Digitalmars-d-learn mailing list