void Display()
{
temp = top;
cout << "The stack at its current state is: ";
while (temp != NULL)
{
cout << temp->info << " ";
temp = temp->next;
}
cout << endl;
_getch();
}
void Push()
{
np = new Node;
cout << "Enter info: ";
cin >> np->info;
if (top == NULL)
top = np;
else
{
np->next = top;
top = np;
}
Display();
}
void Pop()
{
if (top == NULL)
cout << "Underflow" << endl;
else
{
cout << "The element being deleted is: " << top->info;
top = top->next;
}
Display();
}