C-Common-Data-Structures
C-Common-Data-Structures copied to clipboard
Refinement for Stack
Hey TienLung,
Please refer to this API draft and try to refine the implementation.
// The constructor
Stack* StackInit();
// The destructor
void StackDeinit(Stack*);
// Push an item to the top of the stack.
bool StackPush(Stack*, void*);
// Pop an item from the top of the stack.
void StackPop(Stack*);
// Retrieve an item from the top of the stack.
void* StackTop(Stack*);
// Get the number of stored items.
int StackSize(Stack*);
// Set the custom stack element clean method.
void StackSetClean(Stack*);
Regards, ZongXian.