Answers for "c++ print byte as bit"

C++
1

c++ print byte as bit

#include <bitset>
...

char a = -58;    
std::bitset<8> x(a);
std::cout << x << '\n';

short c = -315;
std::bitset<16> y(c);
std::cout << y << '\n';
Posted by: Guest on July-22-2020

Browse Popular Code Answers by Language