Espaços nominais
Variantes
Acções

std::bitset::to_string

Da cppreference.com
< cpp‎ | utility‎ | bitset

 
 
Biblioteca de utilitários
Digite apoio (basic types, RTTI, type traits)
Gerenciamento de memória dinâmica
De tratamento de erros
Utilidades do programa
Variadic funções
Data e hora
Objetos de função
(C++11)
Os operadores relacionais
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Pares e tuplas
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
Troque, avançar e avançar
Original:
Swap, forward and move
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)
 
std::bitset
Tipos de membro
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.
bitset::reference
Funções de membro
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.
bitset::bitset
bitset::operator==
bitset::operator!=
acesso. Elemento
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.
bitset::operator[]
bitset::test
bitset::all
bitset::any
bitset::none
(C++11)

 
bitset::count
Capacidade
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::size
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.
bitset::operator&=
bitset::operator|=
bitset::operator^=
bitset::operator~
bitset::operator<<=
bitset::operator>>=
bitset::operator<<
bitset::operator>>
bitset::set
bitset::reset
bitset::flip
Conversões
Original:
Conversions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
bitset::to_string
bitset::to_ulong
bitset::to_ullong(C++11)
Não-membros funções
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.
Classes auxiliares
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;
(até C++11)



(desde C++11)
Converte o conteúdo do bitset a uma corda. zero usa para representar bits com valor de false e one para representar bits com 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.
A seqüência de caracteres resultante contém N com o primeiro caractere corresponde ao bit (N-1th) passado e do último caractere correspondente ao primeiro 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.

Índice

[editar] Parâmetros

zero -
caractere usado 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 -
caractere usado 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.

[editar] Valor de retorno

a seqüência 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.

[editar] Exemplo

#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';
}

Saída:

00101010
**1*1*1*
OOXOXOXO

[editar] Veja também

retorna uma representação de número inteiro unsigned long dos dados
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.

(função pública membro) [edit]
(C++11)
retorna uma representação de número inteiro unsigned long long dos dados
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.

(função pública membro) [edit]