|
vector::sizepublic member function
size_type size() const; Return size Returns the number of elements in the vector container.This is the number of actual objects held in the vector, which is not necessarily equal to its storage capacity. Vectors automatically reallocate their storage space when needed or when requested with member resize. To retrieve the current storage capacity of a vector you can call to its member capacity. ParametersnoneReturn ValueThe number of elements that conform the vector's content.Member type size_type is an unsigned integral type. Example
Output:
ComplexityConstant.See also
|