I'm trying to create some iterators for my class stack so that I can accomplish something like this when trying to loop through my stack:
for(StackIterator<T> i = begin(); i != end(); ++i)
where end is the 0th element of my stack (in an array), and begin is the element at the "top" of my stack (last element with info in array).
The problem I'm having is understanding how to create the begin() and end() function. I know I should be returning a iterator pointing to the last element for the begin() function and the first element for the end() function, but how would I create these functions? This is what I'm trying but I can't figure out how to make it work: