This is the message that I get from the build log:
mingw32-g++.exe -Wall -fexceptions -g -c C:\Martin\Savitch\Unisa\Unisa\STACKS\StackFrame\Stack.cpp -o obj\Debug\Stack.o
C:\Martin\Savitch\Unisa\Unisa\STACKS\StackFrame\Stack.cpp: In destructor 'stacksavitch::Stack::~Stack()':
C:\Martin\Savitch\Unisa\Unisa\STACKS\StackFrame\Stack.cpp:48:14: warning: variable 'next' set but not used [-Wunused-but-set-variable]
C:\Martin\Savitch\Unisa\Unisa\STACKS\StackFrame\Stack.cpp: In member function 'void stacksavitch::Stack::push(char)':
C:\Martin\Savitch\Unisa\Unisa\STACKS\StackFrame\Stack.cpp:66:36: warning: 'temp_ptr' is used uninitialized in this function [-Wuninitialized]
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 2 warning(s) (0 minute(s), 5 second(s))
//DISPLAY 13.17 Interface File for a Stack Class
//This is the header file stack.h. This is the interface for the class Stack,
//which is a class for a stack of symbols.
#ifndef STACK_H
#define STACK_H
namespace stacksavitch
{
struct StackFrame
{
char data;
StackFrame *link;
};
typedef StackFrame* StackFramePtr;
class Stack
{
public:
Stack( );
//Initializes the object to an empty stack.
Stack(const Stack& a_stack);
//Copy constructor.
~Stack( );
//Destroys the stack and returns all the memory to the freestore.
void push(char the_symbol);
//Postcondition: the_symbol has been added to the stack.
char pop( );
//Precondition: The stack is not empty.
//Returns the top symbol on the stack and removes that
//top symbol from the stack.
bool empty( ) const;
//Returns true if the stack is empty. Returns false otherwise.
private:
StackFramePtr top;
};
}//stacksavitch
#endif //STACK_H