1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex3.1/Stack.hh

28 lines
440 B
C++

//Stack.h
#ifndef STACK_H
#define STACK_H
const int LEN = 80 ; // default stack length
class Stack {
// Interface
public:
Stack() { init(); }
~Stack() {}
int nitems() { return count ; }
bool full() { return (count==LEN) ; }
bool empty() { return (count==0) ; }
void push( double c );
double pop();
void inspect();
// Implementation
private:
void init() { count = 0 ; }
double s[LEN] ;
int count ;
};
#endif