std::stack::top

From cppreference.com
< cpp‎ | container‎ | stack
reference top();
const_reference top() const;

Returns reference to the top element in the stack. This is the most recently pushed element. This element will be removed on a call to pop(). Effectively calls c.back().

Parameters

(none)

Return value

Reference to the last element

Complexity

Constant