I'm trying to write a array into a binary archive but appears 2 weird errors.
The array to be written is pointer array, like a dynamically allocated matrix, does it changes the write process?
it does not matter what the data is or where it came from.
What are the errors?
I suspect you messed up sizeof (this argument to write is total # of bytes to write, so if you had
int x[100] then you write (blah, sizeof(int)*100).
You have to be careful writing objects. If the object contains a pointer, explicit or understood, you have to unravel that so it writes the DATA in the pointer not the POINTER VALUE. For basic types, the above is all you need, but for objects, you usually need to write a function that collapses it to pure bytes that you can write. This includes stl containers, you can't just write a class that has vectors inside, the vector data isnt visible to write directly!