Overloaded operator to access elements in the dynamic array.
index The index of the element to access.
A reference to the element at the specified index.