Espacios de nombres
Variantes

std::bitset::to_string

De cppreference.com
 
 
Biblioteca de servicios
Apoyo del lenguaje
Apoyo de tipos (tipos básicos, RTTI)
Macros de prueba de característica de la biblioteca (C++20)
Servicios de programa
Funciones variádicas
Apoyo de corrutinas (C++20)
Apoyo de contratos (C++26)
Comparación de tres vías (C++20)
(C++20)
(C++20)(C++20)(C++20)  
(C++20)(C++20)(C++20)

 
std::bitset
Tipos de miembros
Original:
Member types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
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.
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.
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Conversiones
Original:
Conversions
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.
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.
(C++11)
 
template<
    class CharT,
    class Traits,
    class Allocator 
> std::basic_string<CharT,Traits,Allocator> to_string() const;
template<
    class CharT = char,
    class Traits = std::char_traits<CharT>,
    class Allocator = std::allocator<CharT> 
> std::basic_string<CharT,Traits,Allocator>
    to_string(CharT zero = CharT(0), CharT one = CharT(1)) const;
(hasta C++11)



(desde C++11)
Convierte el contenido de la bitset en una cadena. Utiliza zero para representar bits con valor de false y one para representar bits con valor de true .
Original:
Converts the contents of the bitset to a string. Uses zero to represent bits with value of false and one to represent bits with value of true.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
La cadena resultante contiene caracteres N con el primer carácter corresponde a la última (N-1th) bit y el último correspondiente al primer bit .
Original:
The resulting string contains N characters with the first character corresponds to the last (N-1th) bit and the last character corresponding to the first bit.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parámetros

zero -
carácter que se utilizará para representar false
Original:
character to use to represent false
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
one -
carácter que se utilizará para representar true
Original:
character to use to represent true
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

la cadena convertida
Original:
the converted string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ejemplo

#include <iostream>
#include <bitset>
int main()
{
    std::bitset<8> b(42);
    std::cout << b.to_string() << '\n'
              << b.to_string('*') << '\n'
              << b.to_string('O', 'X') << '\n';
}

Salida:

00101010
**1*1*1*
OOXOXOXO

Ver también

devuelve una representación entera unsigned long de los datos
Original:
returns an unsigned long integer representation of the data
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]
(C++11)
devuelve una representación entera unsigned long long de los datos
Original:
returns an unsigned long long integer representation of the data
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]
Morty Proxy This is a proxified and sanitized view of the page, visit original site.