C++: Difference between revisions

307 bytes added ,  30 December 2019
Line 285: Line 285:
====std::queue====
====std::queue====
====std::stack====
====std::stack====
[https://en.cppreference.com/w/cpp/container/stack cppreference]
<syntaxhighlight lang="cpp">
std::stack<char> my_stack;
// Push to stack
// You can also use emplace
// Returns void
my_stack.push('a');
// Peek
char top = my_stack.top('a');
// Pop
// Note: returns void
my_stack.pop();
</syntaxhighlight>


===Associative Containers===
===Associative Containers===