I am trying to write and read binary files for a program i am planning to develop.But , while writing the file, instead of binary digits, i get odd letters(inverted L's, superscripted a's, NULL's etc).Also reading the file in binary mode just reads the first character and not the whole byte. Example, 010010 does not give me the corresponding character, rather it just reads 0.
I have written the following code:
FOR READING FILE:
#include<fstream.h>
#include<iostream.h>
int main()
{
ifstream output;
char str;
output.open("TABLEGEN",ios::app|ios::binary);
output.read((char*)&str, sizeof(char));
cout<<str;

}
FOR WRITING FILE
#include<fstream.h>
#include<iostream.h>
int main()
{
ofstream output;
char *str="TABLE";
output.open("TABLEGEN",ios::app|ios::binary);
output.write((char*)&str, sizeof(char));
cout<<str;

}

Is it a problem with Windows not supporting binary read/write functions? or is my compiler non-functional. I use Borland Turbo C++ 3.0.

Please Help.