Vector: Included in namespace Std
Vector<typename> name (N_elem);//Create a vector object named name, which can store n_elem elements of type TypeName
function is more powerful than arrays, but inefficient
Array
Array<typename, n_elem> name;//creates an array object named name that stores N_elem elements of type TypeName.
N_elem can not be variable, efficient and array-like, but more secure and convenient.
Array, Comparison of Array,vector
Each element can be accessed using standard array notation
Array objects can be assigned to another array object, and arrays must be assigned value by element;
Array objects and arrays are stored in the same memory area (stack), and vector objects are stored in free storage or heap;
Arrays tend to be hyper-bounded, unsafe to behave, array and vector objects can also be accessed out of bounds, but can be prevented by member functions at ();
When you use at (), illegal indexes are captured during run time, and the program is interrupted by default, and this extra check causes the runtime to grow longer.
There are also member functions, begin (), and end () to determine the bounds.
Alternatives to arrays