Can anyone show me a good method to express a character in binary in C?
I would need to see a given character as a sequence of 1 and 0.
For example, if I get as an input 'a'
, I would like to see it as 01100001 and finally return 00010110 (a byte with inverted nibbles).
Is it good to use unigned char
? Should I use an 8-element array of integers to store a byte?
int main(void){
unsigned char c = 'a';
return 0;
}