Quote:
Originally posted by bluesource
Well the way I implemented my stack, data-size points to the beginning of the stack, since after a push or a pop, data points to the item after the last available item. In other words, the end of my c-style pointer array is the top of the stack, and the beginning of the array is the bottom of the stack. That being the case, data-1 points to the end of the stack.
Oh, I get it. It works, but I guess it's a bit a matter of taking the abstraction too far IMHO. If it doesn't complicate your design, then it's fine. But the internal representation does not matter anyways, since all you present to the external world is your methods to manipulate the stack. But well, it's your decision.