Check out example codes for "top but in vector c++". It will help you in understanding the concepts better.
Code Example 1
vectorname.back() Parameters : No value is needed to pass as the parameter. Returns : Direct reference to the last element of the vector container.
Learn ReactJs, React Native from akashmittal.com