8 lines
179 B
C++
8 lines
179 B
C++
|
const char* byteToBitString (value) {
|
||
|
char output[9];
|
||
|
output[8] = 0;
|
||
|
for (int i = 0; i < 8; ++i) {
|
||
|
output[7 - i] = (value & (1 << i)) ? '1' : '0';
|
||
|
}
|
||
|
return output;
|
||
|
}
|