/**************************************************************** **** **** This file belongs with the course **** Introduction to Scientific Programming in C++/Fortran2003 **** copyright 2018-2023 Victor Eijkhout eijkhout@tacc.utexas.edu **** **** vectorend.cxx : example of vector end iterator **** ****************************************************************/ #include using std::cin; using std::cout; #include using std::vector; int main() { cout << "End Bracket" << '\n'; { //codesnippet vectorpush vector mydata(5,2); mydata.push_back(35); cout << mydata.size() << '\n'; cout << mydata.back() << '\n'; //codesnippet end } cout << "... bracket" << '\n'; cout << "End Iterator" << '\n'; { //codesnippet vectorpushiterator vector mydata(5,2); mydata.push_back(35); cout << mydata.size() << '\n'; cout << *( --mydata.end() ) << '\n'; //codesnippet end } cout << "... iterator" << '\n'; return 0; }