The Wayback Machine - https://web.archive.org/web/20180411100231/http://es.cppreference.com:80/w/cpp/string/basic_string
Espacios de nombres
Variantes
Acciones

std::basic_string

De cppreference.com
< cpp‎ | string


 
 
Strings biblioteca
Terminadas en nulo
Original:
Null-terminated strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Cadenas de bytes
Multibyte cuerdas
Cadenas anchas
Clases
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_string
 
std::basic_string
Las funciones miembro
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elemento acceso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Operaciones
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Buscar
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Clases de ayuda
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
 
Definido en la cabecera <string>
template<

    class CharT,
    class Traits =std::char_traits<CharT>,
    class Allocator =std::allocator<CharT>

>class basic_string;
La plantilla de clase basic_string almacena y manipula secuencias de caracteres similares a los objetos (es decir, objetos para que una especialización de la clase std::char_traits o rasgos compatible es siempre) .
Original:
The class template basic_string stores and manipulates sequences of char-like objects (that is, objects for which a specialization of std::char_traits or compatible traits class is provided).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Los elementos de un basic_string se almacenan de forma contigua, es decir, para un basic_string s, &*(s.begin()+ n)==&*s.begin()+ n para cualquier n en [0, s.size()), o, de manera equivalente, un puntero a s[0] se puede pasar a funciones que esperan un puntero al primer elemento de una matriz charT[]. (desde C++11)
Original:
The elements of a basic_string are stored contiguously, that is, for a basic_string s, &*(s.begin()+ n)==&*s.begin()+ n for any n in [0, s.size()), or, equivalently, a pointer to s[0] can be passed to functions that expect a pointer to the first element of a charT[] array. (desde C++11)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Varias especializaciones para tipos de caracteres comunes están disponibles:
Original:
Several specializations for common character types are provided:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Defined in header <string>
Tipo
Original:
Type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
std::stringstd::basic_string<char>
std::wstringstd::basic_string<wchar_t>
std::u16stringstd::basic_string<char16_t>
std::u32stringstd::basic_string<char32_t>

Contenido

[editar]Tipos de miembros

Miembro de tipo
Original:
Member type
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Definition
traits_typeTraits
value_typeTraits::char_type
allocator_typeAllocator[editar]
size_type
Tipo entero sin signo (por lo general size_t)
Original:
Unsigned integral type (usually size_t)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[editar]
difference_type Signed integer type (usually ptrdiff_t) [editar]
referenceAllocator::reference(hasta C++11)
value_type&(desde C++11)[editar]
const_referenceAllocator::const_reference(hasta C++11)
const value_type&(desde C++11)[editar]
pointerAllocator::pointer(hasta C++11)
std::allocator_traits<Allocator>::pointer(desde C++11)[editar]
const_pointerAllocator::const_pointer(hasta C++11)
std::allocator_traits<Allocator>::const_pointer(desde C++11)[editar]
iteratorRandomAccessIterator[editar]
const_iterator
Iterador constante de acceso aleatorio
Original:
Constant random access iterator
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
[editar]
reverse_iteratorstd::reverse_iterator<iterator>[editar]
const_reverse_iteratorstd::reverse_iterator<const_iterator>[editar]

[editar]Las funciones miembro

construye una basic_string
Original:
constructs a basic_string
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úblico)[editar]
asigna valores a la cadena
Original:
assigns values to the string
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úblico)[editar]
asignar caracteres a una cadena
Original:
assign characters to a string
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úblico)[editar]
devuelve el asignador asociado
Original:
returns the associated allocator
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úblico)[editar]
Elemento acceso
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
acceder carácter especificado con comprobación de límites
Original:
access specified character with bounds checking
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úblico)[editar]
acceder carácter especificado
Original:
access specified character
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úblico)[editar]
(C++11)
accede al primer carácter
Original:
accesses the first character
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úblico)[editar]
(C++11)
accede al último carácter
Original:
accesses the last character
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úblico)[editar]
devuelve un puntero al primer carácter de una cadena
Original:
returns a pointer to the first character of a string
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úblico)[editar]
devuelve un no modificable de caracteres estándar C versión amplia de la cadena
Original:
returns a non-modifiable standard C character array version of the string
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úblico)[editar]
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
devuelve un iterador al principio
Original:
returns an iterator to the beginning
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úblico)[editar]
(C++11)
devuelve un iterador hasta el final
Original:
returns an iterator to the end
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úblico)[editar]
devuelve un iterador inverso al principio
Original:
returns a reverse iterator to the beginning
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úblico)[editar]
(C++11)
devuelve un iterador inverso hasta el final
Original:
returns a reverse iterator to the end
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úblico)[editar]
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
comprueba si la cadena está vacía
Original:
checks whether the string is empty
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úblico)[editar]
returns the number of characters
(función miembro público)[editar]
devuelve el número máximo de caracteres
Original:
returns the maximum number of characters
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úblico)[editar]
reservas de almacenamiento
Original:
reserves 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úblico)[editar]
devuelve el número de caracteres que se pueden almacenar en el almacenamiento asignado actualmente
Original:
returns the number of characters 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úblico)[editar]
reduce el uso de memoria por la liberación de memoria no utilizada
Original:
reduces memory usage by freeing unused memory
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úblico)[editar]
Operaciones
Original:
Operations
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
borra el contenido
Original:
clears the contents
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úblico)[editar]
inserta caracteres
Original:
inserts characters
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úblico)[editar]
removes characters
(función miembro público)[editar]
añade un carácter a la final
Original:
appends a character to the end
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úblico)[editar]
(C++11)
elimina el último carácter
Original:
removes the last character
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úblico)[editar]
añade caracteres al final
Original:
appends characters to the end
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úblico)[editar]
añade caracteres al final
Original:
appends characters to the end
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úblico)[editar]
compara dos cadenas
Original:
compares two strings
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úblico)[editar]
reemplaza todas las apariciones de los caracteres especificados
Original:
replaces every occurrence of specified characters
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úblico)[editar]
devuelve una subcadena
Original:
returns a substring
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úblico)[editar]
copias personajes
Original:
copies characters
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úblico)[editar]
cambia el número de caracteres almacenados
Original:
changes the number of characters 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úblico)[editar]
intercambia los contenidos
Original:
swaps the contents
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úblico)[editar]
Buscar
Original:
Search
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
encontrar caracteres de la cadena
Original:
find characters in the string
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úblico)[editar]
Encuentra la última aparición de una subcadena
Original:
find the last occurrence of a substring
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úblico)[editar]
encontrar la primera aparición de caracteres
Original:
find first occurrence of characters
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úblico)[editar]
encontrar la primera ausencia de caracteres
Original:
find first absence of characters
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úblico)[editar]
encontrar la última aparición de caracteres
Original:
find last occurrence of characters
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úblico)[editar]
encontrar última ausencia de caracteres
Original:
find last absence of characters
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úblico)[editar]

Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[estático]
valor especial. El significado exacto depende del contexto
Original:
special value. The exact meaning depends on the context
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(miembro público estático constante)[editar]

[editar]Terceros funciones

concatena dos cadenas o una cadena de caracteres y una
Original:
concatenates two strings or a string and a char
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de función)[editar]
lexicográfico compara dos cadenas
Original:
lexicographically compares two strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de función)[editar]
el algoritmo se especializa std::swap
Original:
specializes the std::swap algorithm
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de función)[editar]
Entrada / salida
Original:
Input/output
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
realiza secuencia de E / S en cadenas
Original:
performs stream I/O on strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(plantilla de función)[editar]
leer datos de una secuencia de E / S en una cadena
Original:
read data from an I/O stream into a string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]
Conversiones numéricas
Original:
Numeric conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)(C++11)(C++11)
convierte una cadena a un entero con signo
Original:
converts a string to an signed integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]
(C++11)(C++11)
convierte una cadena a un entero sin signo
Original:
converts a string to an unsigned integer
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]
(C++11)(C++11)(C++11)
convierte una cadena en un valor de coma flotante
Original:
converts a string to an floating point value
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]
(C++11)
Convierte un valor de coma flotante o integral a string
Original:
converts an integral or floating point value to string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]
(C++11)
Convierte un valor de coma flotante o integral a wstring
Original:
converts an integral or floating point value to wstring
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(función)[editar]

[editar]Clases de ayuda

apoyo hash de cadenas
Original:
hash support for strings
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(especialización de plantilla de clase)[editar]
close