Originally Posted by
shrink_tubing
It still demanded the first address be cast to a char*.
Yes, though you might want to use a C++-style cast to make the cast more explicit:
Code:
std::ofstream writeFile;
writeFile.open("Mesh.bin", std::ios::out | std::ios::binary);
if (!newVertexArray.empty())
writeFile.write(reinterpret_cast<char*>(&newVertexArray[0]),
newVertexArray.size() * sizeof(newVertexArray[0]));
I have also chosen to change the sizeof expression to one that does not need to be changed should the value type of newVertexArray change.