I have the following code
void test(MyDataType * t)
{
vector<MyDataType> tmp;
tmp.push_back(MyDataType(2,24));
t = tmp.data();
}
void test2()
{
MyDataType * t;
test(t);
// Do some stuff with the data pointed by t
}
When will the data stored in the vector freed? It is out of scope after the test
function call end. Is that correct?