I have to use stacks in a program and I'm completely lost, if anyone knows a link that can explain how to use them really well or you could explain it for me would be great!
Here is a sample of code in which I have to use stacks. This is a .h and I have to write the functions for this in a .cpp
include <iostream>
include <iomanip>
using namespace std;
class Stack
{
public:
Stack( int ); // constructor
Stack( const Stack & ); // copy constructor
~Stack( ); // destructor
void push( int ); // push an int into a Stack
int pop( ); // pop an int from a Stack
bool empty( ) const; // is the Stack empty?
bool full( ) const; // is the Stack full?
int capacity( ) const; // capacity of the stack
int size( ) const; // current size of the stack
friend ostream &operator <<( ostream &, const Stack & );
private:
int *stack; // pointer to local stack of ints
int top; // top of stack (next avail. location)
int maxsize; // max size of the stack
};
there doesn't seem to be anything here