in reply to array reference
Yes, it's safe. There is an (invisible) indirection layer that also contains info such as the size of the array.
By the way, adding or removing elements from the front or back of the array doesn't cause a reallocation, so those operations are very efficient.
|
|---|