C++: Difference between revisions

78 bytes added ,  30 December 2019
Line 295: Line 295:


// Peek
// Peek
// Always make sure stack is not empty
char top = my_stack.top('a');
char top = my_stack.top('a');


// Pop
// Pop
// Note: returns void
// Note: returns void
// Always make sure stack is not empty
my_stack.pop();
my_stack.pop();
</syntaxhighlight>
</syntaxhighlight>