// Abstract Data Type Stack demo
// Marc Chee, April 2019

// This file describes the interface to a stack of ints
// It must be included in other code files to be of use

// ======================================================
// The type "stack" refers to a stack_internals pointer.
// In other files, programs can use stack, but they will
// not get direct access to the stack's internal workings
// nor will they know exactly what they are
typedef struct stackInternals *stack;

// ======================================================
// These functions are the only way external code can
// manipulate a stack.

// functions to create and destroy queues
stack stackCreate();
void stackFree(stack s);

// Add and remove items from queues
// Removing the item returns the item for use
void stackPush(stack s, int item);
int stackPop(stack s);

// Check on the size of the queue
int stackSize(stack s);

Resource created Tuesday 23 April 2019, 02:02:06 AM.

file: stack.h


Back to top

COMP1511 19T1 (Programming Fundamentals) is powered by WebCMS3
CRICOS Provider No. 00098G