Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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() << '
'
              << b.to_string('*') << '
'
              << b.to_string('O', 'X') << '
';
}
Source by en.cppreference.com #
 
PREVIOUS NEXT
Tagged: #put #bitset #string
ADD COMMENT
Topic
Name
5+1 =