I'm following along with the OpenGL Super Bible 5th edition, and they define a vector(vector as in math) as
typedef float M3DVector3f[3];
I'm trying to add an instance of this to an std::vector(the 're sizable array' in c++), however I keep getting an error saying:
array initialization needs curly braces
The way I defined the std::vector and the way I'm adding to it is:
std::vector<M3DVector3f> vertices;
float vertex[3];
sscanf_s(line.c_str(), "%*s %f %f %f", &vertex[0], &vertex[1], &vertex[2]);
M3DVector3f v = {vertex[0], vertex[1], vertex[3]};
vertices.push_back(v);
I've gathered that the problem is with the vertices.push_back(v) call, because I don't get an error when I comment that out. Could someone explain to me and help me figure out why it won't let me add this vector to my vector?