This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Syntax | Description | |
|---|---|---|
| v[i] | Returns the ith element of a vector | |
| v.begin() | Returns an iterator pointing to the first element of the vector | |
| v.end() | Returns an iterator pointing to the last element of the vector | |
| v.size() | Returns the number of elements in the vector | |
| v.capacity() | Returns the size of underlying array | |
| v.max_size() | Returns the maximum number of elements that vector can hold in worst case according to the memory available. | |
| v.push_back() | It is used to insert an element at the end of the vector | |
| v.pop_back() | It is used to delete the last element of the vector | |
| v.insert(v.begin()+index;value) | To insert an element at any given position |