![]() |
![]()
| ![]() |
![]()
NAMEstd::vector::back - std::vector::back Synopsis reference back(); (until C++20)
Parameters(none) Return valueReference to the last element. ComplexityConstant. Notes For a non-empty container c, the expression c.back() is
equivalent to
ExampleThe following code uses back to display the last element of a std::vector<char>: // Run this code
Output:The last character is 'f'. See also front access the first element
|