Standard Library Vector type
Use the required header file:
# Include
Vector: Vector is a class template. It is not a data type. Vector is a data type.
I. Definition and initialization
Vector v1; // The default constructor v1 is empty.
Vector
Standard Library vector typeUse the required header file:# Include Vector: vector is a class template. It is not a data type. Vector is a data type.
I. Definition and initializationVector V1; // The default constructor V1 is empty.Vector V2 (V1)
Vector C ++, VectorVector container typeA vector container is a template class that can store any type of objects (but must be the same class object ). The vector object can efficiently add elements at runtime, and the elements in the vector are
VectorSimilar to the built-in array,It has a continuous memory and the starting address remains unchanged.Therefore, it supports random access, that is, the [] Operator. However, because its memory space is continuous, inserting and deleting in the
1VectorThe vector corresponds to an arrayAllocates a contiguous memory space in memory for storage. Supports storage that does not specify a vector size. STL internal implementation, first allocate a very large memory space to store, that is, the
STLYesC ++Class Library.STLThe containers in are queue containers and associated containers, container adapter congtainer adapters: stack, queue, priority queue), bit_set, and string_package.
In the series, I will introduce the list, vector, deque
Guoxinmiao8.blog.sohu.com/103762653.html
STL is part of the ANSI/ISO standard for C ++ and can be used in all c ++ language compilers and all platforms. The same version of STL is available in any hardware configuration. STL provides a large number
Reference http://dev.csdn.net/article/48/article/48/article/49/49091.shtm
Void cvectortest: showinfo (string name, vector & vintvector){// C. max_size () returns the maximum number of data in the container.// C. At (idx) returns the data referred
Java Container---List,map,setCollection├list│├linkedlist│├arraylist│└vector│└stack└setMap├hashtable├hashmap└weakhashmapThe collection interface Collection is the most basic collection interface, and a collection represents a set of object, the
Turn from: http://www.cnblogs.com/hnrainll/archive/2013/04/08/3006638.html
The difference between the Set,list,map,vector,arraylist
The difference between the Set,list,map,vector,arraylist
Java Container---List,map,setCollection├list│├linkedlist│
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.