When fread or fwrite is used to read/write a struct, it appends an extra bytes to the end of the struct. This can be bad when reading and writing to file. In my case, I can work around it.
This may be typical behavior in C++
[edit] it seems that this is not unheard of and is NOT a bug. I will leave the post so that someday someone can see what i have learned.