X Tutup
The Wayback Machine - https://web.archive.org/web/20210507021310/https://es.cppreference.com/w/cpp/container/vector/size
Espacios de nombres
Variantes
Acciones

std::vector::size

De cppreference.com
< cpp‎ | container‎ | vector
 
 
 
 
size_type size() const;
(hasta C++11)
size_type size() const noexcept;
(desde C++11)
(hasta C++20)
constexpr size_type size() const noexcept;
(desde C++20)

Devuelve el número de elementos en el contenedor; es decir, std::distance(begin(), end()).

Contenido

[editar] Parámetros

(Ninguno)

[editar] Valor de retorno

El número de elementos en el contenedor.

[editar] Complejidad

Constante.

[editar] Ejemplo

Plantilla:cpp/container/vector/example size

[editar] Véase también

devuelve el número de elementos que se pueden almacenar en el almacenamiento asignado actualmente
Original:
returns the number of elements that can be held in currently allocated storage
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]
Comprueba si el contenedor está vacío
(función miembro pública) [editar]
Devuelve el número máximo posible de elementos
(función miembro pública) [editar]
cambia el número de elementos almacenados
Original:
changes the number of elements stored
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función miembro pública) [editar]
X Tutup