stl::vector problems (memory?)
Hello, I am experimenting with the stl::vector again, and I have this class:
now here is the code:
Looks as it works? No, it doesnt, the MessageBox shows that Number is garbage and NOT 5 as expected. However, if I test this inside the Fill function (the exact code), it shows the real value assigned to Number!
//I push one structure.
t.Number = 5;
sprintf (str, "%i", vec->Number);
MessageBox(0, str, "", 0);
Oh, I use pointer in the vector, as I might change the Number later, I want it to be updated in the vector.
What is happening here?