push

Syntax:

    #include <stack>
    void push( const TYPE& val );

The function push() adds val to the top of the current stack.

For example, the following code uses the push() function to add ten integers to the top of a stack:

   stack<int> s;
   for( int i=0; i < 10; i++ ) s.push(i);

Related Topics: pop