Answers for "how to put bitset into a string in c++"

C++
1

how to put bitset into a string in c++

#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';
}
Posted by: Guest on February-10-2021

Code answers related to "how to put bitset into a string in c++"

Browse Popular Code Answers by Language