I have recently learned how to overload operators in c++ classes, but I can't come up with a way to simulate the offset([]) operator. The best I have is returning a pointer to the wanted element, but the * operator has to be used to access the value the pointer points to and I don't want that. The reason why I'm not just returning the value of the element is because then I can't write to the internal array. Basically, I want to be able to make a class c with an internal array of ints (that holds 5 ints), and then access the third int via c[2] so I can do these two things: