C++ Vector front() It gives a reference to the first element of vector. Syntax Consider a vector.Syntax would be: v.front(); Parameter This…
back()
-
-
C++ Vector max_size() This function is used to provide the maximum size that vector can hold. Syntax Consider a vector ‘v’ and…
-
C++ Vector begin() This function is used to point the first element of the vector. begin() vs front() The begin() function is…
-
C++ Vector operator[]() This function is used to access a specified element. Syntax Consider a vector ‘v’ and position ‘pos’. Syntax would…
-
C++ Vector capacity() This function determines the current capacity of the vector. Note: Capacity of the vector can be equal or greater…
-
C++ Vector operator=() This function assigns new values to the vector container and replacing old ones. Syntax Consider two vectors ‘v’ and…
-
C++ Vector cbegin() This function is used to point the first element of the vector container. cbegin() vs begin() The cbegin() function…
-
C++ Vector cend() This function is used to point to the past-the-last element (element after the last element) in the vector. cend()…
-
C++ Vector clear() This function removes all the elements from the vector. Syntax Consider a vector v. Syntax would be: v.clear(); Parameter…
-
C++ Vector rbegin() The rbegin() stands for ‘reverse beginning’ and is used to point the last element of the vector. Syntax Consider…