I am attempting to display a string representation of an int16_t's Two's Complement. I find the two's complement by (uint16_t)~value + 1;
How would I add the 16 bits to a string?
char* getBits(const int16_t value) {
uint16_t complement = (uint16_t)~value + 1;
char bits = malloc(16*sizeof(char*))
for (int i = 0; i < 16; i++) {
bits[i] = // something
}
return bits;
}