/**************************************************************** **** **** This file belongs with the course **** Introduction to Scientific Programming in C++/Fortran2003 **** copyright 2016-2021 Victor Eijkhout eijkhout@tacc.utexas.edu **** **** arraystd.cxx : use of std::vector **** ****************************************************************/ #include using std::cin, std::cout; #include using std::vector; int main() { int array_length; cout << "How many elements? "; cin >> array_length; //examplesnippet stdvector vector my_array(array_length); //examplesnippet end // vector my_array; my_array.reserve(array_length); for (int i=0; i