To answer the question in your title, yes. write's first argument must be a pointer to char where the number of available characters starting at that pointer match the second argument.
everything between these values became null.
Can you elaborate? What do you want to happen (with examples) and what's actually happening (with examples)?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
But when I close the file, all the other values become null (0), and only the values I modified stay as they are.
I suspect you're doing more than you say, but each time you open the file strictly for output, it will be truncated to zero length. Try this instead:
fstream saveFile(saveFilePath, ios::in | ios::out | ios::binary);
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401