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