C:\Martin\Savitch\SavitchDownloads\Chapter13\Chapter13\StackFrame\stack.cpp:10:9: error: expected initializer before 'Stack'
C:\Martin\Savitch\SavitchDownloads\Chapter13\Chapter13\StackFrame\stack.cpp:9:1: error: expected initializer before 'using'
using namespace std;
//Here is the copy constructor:
//The definitionof the copy constructor is Self-Test Exercise 11.
// {
Stack::Stack(const Stack& a_stack)
{
if (a_stack.top == NULL)
top = NULL;
else
{
StackFramePtr temp = a_stack.top; //temp moves
//through the nodes from top to bottom of a_stack
StackFramePtr end; //Points tp end of the new stack.
end = new StackFrame;
end->data = temp->data;
top = end;
//First node created and filled with data.
//New nodes are now added AFTER this first node.
temp = temp->link;
while (temp != NULL)
{
end->link = new StackFrame;
end = end->link;
end->data = temp->data;
temp = temp->link;
}
end->link = NULL;
}
}
//Copy Constructor
Well since it doesn't appear that you posted the problem part of the code it is hard to tell what your issue actually is (I don't see a "using namespace std;" anywhere in your code and since the problem is before that line?).