// dstack.h -- Dynamic stack (DStack) declaration and function prototypes. // // Functions: // // init(S, int N) initalized stack of size N // push(S,val) push new value on top of stack // pop(S) returns (and removes) top value of stack // num_items(S) returns number of items currently on stack // size(S) returns max number of items stack can hold // full(S) returns 1 if stack is full, 0 otherwise // empty(S) returns 1 if stack is empty, 0 otherwise // cout << S print stack contents // remove(S) release memory utilized by stack // typedef struct { float *bottom; float *top; int size; } DStack; void init(DStack &S, int size); void remove(DStack &S); void push(DStack &S, float val); int num_items(const DStack &S); float pop(DStack &S); int full(const DStack &S); int empty(const DStack &S); ostream& operator<<(ostream &os, const DStack &);