I have some code I am using to take an object of a specific type (e.g., a char or an int) and, using a struct whose members are "unsigned"s of length 1.
Example:
I try to open the file in Notepad, and I get a bunch of 1's and 0's - shouldn't I be getting a mush of blank spaces and funky Chinese-looking characters?
Am I mistakenly outputting actual "int" 1s and 0s, instead of single bits to the file?
Yes, they are unsigned (int)s so when you output them, you are outputting basically an unsigned int where the compiler only cares about the first bit. You would need to open your file in binary mode to do what you are describing.
You need to "un"convert back to a char and then output the char.
Bitfields are only useful in the abstract. They are not safe for binary formatting, unless you are targeting a specific version of a specific compiler.
Also, your code is overdone. To simply extract a bit: