The inside of your for-loop does not make any sense at all to me. Could you perhaps make a comment about every single line and tell us exactly what you are trying to do and what your idea was?
if...
Type: Posts; User: Cornix
The inside of your for-loop does not make any sense at all to me. Could you perhaps make a comment about every single line and tell us exactly what you are trying to do and what your idea was?
if...
That does not make any sense whatsoever.
The idea of a stack is that you cant insert values at random locations.
With your method your data structure would no longer be a stack, so please clarify.