This header file requires stdio.h & stdlib.h header files to be present in your compiler to work properly.
This header file can perform 9 Operations:
-
Creating a Stack { stack CreateStack(int Capacity); },
-
Query of Capacity of the Stack { int CapacityOfStack(stack Stack); },
-
Status of the Stack { void StatusOfStack(stack Stack); },
-
Push an element into the Stack { stack Push(stack Stack); },
-
Pop an element from the Stack { stack pop(stack Stack); },
-
Peek of the Stack { void Peek(stack Stack); },
-
Displaying all the elements of the Stack { void DisplayStack(stack Stack); },
-
Flushing all the elements of the Stack { stack FlushStack(stack Stack); },
-
Freeing the Stack { void FreeStack(stack Stack); }.
WARNING: Don't forget use the FreeStack() function at the end of your program, as this header file uses DMA (calloc()) method to allocate memory dynamically which needs to be freed after the execution to prevent memory leak.