Just on the following code do I need to allocate memory with new for floatArray or will the copy function allocate memory for me?
Also is it okay to copy a constant vector to an array this way? Why?
vector<float> floatVector;
//filled floatVector here
float *floatArray = new float[floatVector.size()];
copy(floatVector.begin(),floatVector.end(),floatArray);
delete[] floatArray;
std::copydoesn’t allocate memory, you should do it yourself.