now, think fp a pointer to a bynary data. the writing should be:
fwrite(str, sizeof(char), strlen(str), fp);
but, what should I do to read the string from the bynary file??
I don't know the string lenght in reading process so I cannot tell the third parameter of the fread() function...