Search
 
SCRIPT & CODE EXAMPLE
 

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') << '
';
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: convert all characters in string to uppercase c++ 
Cpp :: copy a part of a vector in another in c++ 
Cpp :: data types ranges c++ 
Cpp :: c++ pointer null vs nullptr 
Cpp :: slice std::array cpp 
Cpp :: sleep system function linux c++ 
Cpp :: number of words in c++ files 
Cpp :: resize 2d vector c++ 
Cpp :: file open cpp 
Cpp :: c++ fizzbuzz 
Cpp :: cpp initialize multidimensional vector 
Cpp :: c++ find_if 
Cpp :: C++ array sort method 
Cpp :: c++ get char of string 
Cpp :: restting a queue stl 
Cpp :: int to hex arduino 
Cpp :: hamming distance c++ 
Cpp :: functors in c++ 
Cpp :: C++ String Length Example 
Cpp :: c++ set comparator 
Cpp :: how to find the size of a character array in c++ 
Cpp :: sqrt in c++ 
Cpp :: how to find last character of string in c++ 
Cpp :: how to print a text in c++ 
Cpp :: string split by space c++ 
Cpp :: new float array c++ 
Cpp :: how to calculate bitwise xor c++ 
Cpp :: convert integer to string in c++ 
Cpp :: C++ New Lines 
Cpp :: Visual studio code include path not working c++ 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =