C: l'Écriture et la Lecture d'une chaîne à partir d'un fichier binaire

Je veux stocker des chaînes de caractères dans un fichier binaire, avec beaucoup d'autres données, de messagerie instantanée à l'aide du code ci-dessous (lorsque je l'utilise pour de vrai les chaînes seront malloc avais) je peux écrire dans le fichier. Ive a regardé dans un éditeur hexadécimal. Je ne suis pas sûr im écrit le terminateur null correctement (ou si j'en ai besoin). quand je l'ai lu en retour je reçois la même longueur de la chaîne que j'ai stocké, mais pas la chaîne. ce que je fais mal?

FILE *fp = fopen("mybinfile.ttt", "wb");

char drumCString[6] = "Hello
FILE *fp = fopen("mybinfile.ttt", "wb");
char drumCString[6] = "Hello\0";
printf("%s\n", drumCString);    
//the string length + 1 for the null terminator
unsigned short sizeOfString = strlen(drumCString) + 1;
fwrite(&sizeOfString, sizeof(unsigned short), 1, fp);
//write the string
fwrite(drumCString, sizeof(char), sizeOfString, fp);
fclose(fp);
fp = fopen("mybinfile.ttt", "rb");  
unsigned short stringLength = 0;
fread(&stringLength, sizeof(unsigned short), 1, fp);
char *drumReadString = malloc(sizeof(char) * stringLength);
int count = fread(&drumReadString, sizeof(char), stringLength, fp);
//CRASH POINT
printf("%s\n", drumReadString);
fclose(fp); 
"
; printf("%s\n", drumCString); //the string length + 1 for the null terminator unsigned short sizeOfString = strlen(drumCString) + 1; fwrite(&sizeOfString, sizeof(unsigned short), 1, fp); //write the string fwrite(drumCString, sizeof(char), sizeOfString, fp); fclose(fp); fp = fopen("mybinfile.ttt", "rb"); unsigned short stringLength = 0; fread(&stringLength, sizeof(unsigned short), 1, fp); char *drumReadString = malloc(sizeof(char) * stringLength); int count = fread(&drumReadString, sizeof(char), stringLength, fp); //CRASH POINT printf("%s\n", drumReadString); fclose(fp);