I have a string in char a=00110010
which is the ascii code of '2'.
Now i want to write this in a text (or binary) file as binary bits.
So that when i open the file in binary mode and read a character char ch
ifstream fin; fin>>ch;
output should be '2' only.
Since 'a' is 101 byte array, would
ofstream fout; fout<<ch;
this code will write 101 characters in the file or only 8 characters?