Vector is a type of template .. </P> <p> usage: <br/> vector <data type> variable name; </P> <p> vector <int> VI; <br/> there are multiple methods </P> <p> vector <int> VI; save an object of the int type. the initialization value is null <br/> vector <int> VI (V2); V2 is a copy of VI <br/> vector <int> VI (10 ); object saved as Int. the initialization value is 10 <br/> vector <int> VI (n, 10 ); save n elements with a value of 10 </P> <p> press the elements with push_back like a vector. <br/> for example, Vi. push_back (10); <br/> Use VI. empty () determines whether VI is null <br/> Use VI. size () gets the number of VI elements </P> <p> iterator </P> <p> uses iterator to access elements of a vector object .. </P> <p> Method of Using iterator <br/> vector <int>: iterator it </P> <p> iterator begin () and end () method <br/> vector <int>: iterator it = VI. begin (); create the iterator it and initialize the subscript VI [0]; <br/> vector <int >:: iterator it = VI. end (); Create and point the iterator to the end of VI </P> <p> * It indicates the value of the current element (* is the dereference operator) </P> <p> Use Vector <int>: iterator to create an iterator .. access and modify data, vector also provides a const_iterator type <br/> This type only allows access to vector data and cannot be modified </P> <p> the iterator can be calculated as shown in <br /> vector <int>:: iterator it = VI. begin (); It = 0 </P> <p> it + 3; it = 3; </P> <p> it ++; it = 4; and so on </P> <p>