Espaces de noms
Variantes
Affichages
Actions

std::bitset::to_string

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

 
 
 
std::bitset
Types de membres
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
Les fonctions membres
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!=
Elément d'accès
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
Capacité
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
Modificateurs
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
Conversions
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)
Tiers fonctions
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.
operator&
operator|
operator^
operator<<
operator>>
Classes d'aide
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.
std::hash (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;
(avant C++11)



(depuis C++11)
Convertit le contenu de la bitset à une chaîne. zero utilise pour représenter bits avec la valeur de false et one pour représenter bits avec la valeur 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 chaîne résultante contient des caractères N avec le premier caractère correspond à la dernière (N-1th) bit et le dernier caractère correspondant au premier 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.

Sommaire

[modifier] Paramètres

zero -
caractère à utiliser pour false représenter
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 -
caractère à utiliser pour true représenter
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.

[modifier] Retourne la valeur

la chaîne convertie
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.

[modifier] Exemple

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

Résultat :

00101010
**1*1*1*
OOXOXOXO

[modifier] Voir aussi

renvoie une représentation entière unsigned long des données
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.

(fonction membre publique) [edit]
(C++11)
renvoie une représentation entière unsigned long long des données
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.

(fonction membre publique) [edit]