Array implementation of stack in C