push [C++ Reference]
Keywords: stl,stack,push
Date: 2008-10-14T15:42:10-0700

[[push]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- fr
- it
- jp
- pl
- ru
- tr

## 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

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •