[ Web Proxy ]
URL:
Viewing: https://cs.cppreference.com/cpp/container/stack/push [Back]  [Original]

push cppreference.com
cppreference.com
Jmenn prostory
Varianty

push

Z cppreference.com
<tbody> </tbody>
void push(const value_type& value);

Funkce push() pid jeden prvek na vrchol zsobnku.

Pklad

stack<int> s;
for( int i = 0; i < 5; i++ )
{
   s.push(i);
}
while( !s.empty() )
{
   cout << s.top() << endl;
   s.pop();
}

Vstup:

5
4
3
2
1

Pbuzn tmata: pop


Web Proxy Viewer  |  New URL  |  Original Page