146 Chapter 7
40 // No assignment operator
41 stack & operator = (const stack &);
42 public:
43 // Push an item on the stack
44 void push(
45 const int item // Item to push
46 ) {
47 data[count] = item;
48 ++count;
49 }
50 // Remove the an item from the stack
51 int pop(void) {
52 --count;
53 return (data[count]);
54 }
55
56 // Function to count things in
57 // an array of stacks
58 friend void stack_counter(
59 stack stack_array[],
60 const int n_stacks
61 );
62 };
63
64 /************************************************
65 * safe_stack -- Like stack, but checks for *
66 * errors. *
67 * *
68 * Member functions: push and pop *
69 * (just like stack) *
70 ************************************************/
71 class safe_stack : public stack {
72 public:
73 const int max; //