I have a string in char a[100]=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
say via
ifstream fin;
fin>>ch;
and then
cout<<ch;
output should be '2' only.
Another question?
Since 'a' is 101 byte array, would
ofstream fout;
fout<<ch;
this code will write 101 characters in the file or only 8 characters?