Writing contents of an std::vector to a binary file! ;o)
I have already written the contents of a regular good old array to a bin file many times. The program I've made needs some resizing to take place in it though - std::vector needed. But I want to write the contents of that std::vector out to a binary file. Up to now it's used this command for a regular array:
But I know that happy simplicity will abruptly end when trying to do it with an std::vector. I haven't a clue how to do this. Has *anyone* got any ideas.
writeFile.open("Mesh.bin", std::ios::out | std::ios::binary);
writeFile.write((char*)newVertexArray, VERTEXARRAYSIZE * sizeof(float));