4.1.4 Push

To push an item, we just set the element that is one beyond the current size of the underlying array:

void Stack_push(struct Stack *pStack, char v)
{
  ArrayADT_setElement((struct ArrayADT *)pStack,
                      ArrayADT_getsize((struct ArrayADT *)pStack),
                      v);
}



Copyright © 2006-10-23 by Tak Auyeung