c++ back()

Explanation of C++ back() Function

The back() function in C++ is used to access the last element of a container. It returns a reference to the last element in the container. The container could be a std::vector, std::string, std::deque, or any other container that supports this operation. If the container is empty, calling back() results in undefined behavior.