vector<float*> push_back() problem
Hello,
I have a problem with the vector<vector<float*>>. Here is the code:
Code:
std::vector<float*> one_vector;
for(int i=0; i< 49; i++)
{
float one_float[3]={(float)i, (float)i, (float)i};
one_vector.push_back(one_float);
}
With breadpoint, I saw that, after each push_back, one_vector changes unexpectly.
when i=0, one_vector={0.0};
when i=1, one_vector={1.0, 1.0};
when i=2, one_vector={2.0,2.0, 2.0};
...
Have no idea, why the old elements are all changed after push_back().
Does anyone know what's going on there?
Thanks in advance.