#include <vector> #include <iostream> int main() { std::vector<int> v; v.push_back(42); std::cout << v.size() << " "; std::cout << v.back() << " "; } Output: 1 42