Warning!It must be noted that if you wish to tuck into the structure of the stack, elements are placed within a 'C' array of pointers and the first element is at [1] *not* [0] as you would expect. The stack_ptr variable points to the current head of the stack, for instance if stack_ptr is equal to 1, then [1] has a value in it.
Stacks are another useful data structure. Here is a stright forward implementation.
|
|
|
|
|
|
|