fork download
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6. vector<int> abc;
  7. abc = { 5, 10, 15, 20 };
  8. abc.resize(4);
  9. std::cout << *(abc.end()+100) << std::endl;
  10. *(abc.end()+100) = 10;
  11. std::cout << abc.back() << std::endl;
  12. std::cout << *(abc.end()+100) << std::endl;
  13. std::cout << "Capacity: " << abc.capacity() << std::endl;
  14. std::cout << "Size: " << abc.size() << std::endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 15224KB
stdin
Standard input is empty
stdout
0
20
10
Capacity: 4
Size: 4