STL:<stack> container
For using stack container we have to include <stack> in our program.We already know that stack is last in first out system.Mainly stack has two operations 1.push operation & 2.pop operation.
There are 5 member functions in the <stack> container.They are:
Suppose x is a stack
1.x.push(value);//for inserting a value in stack.
2.x.pop();//for removing the top element.
3.x.top();returns the top element of the stack.
4.x.empty();returns a boolean value that the is empty or not.
5.x.clear();for removing the entire stack.