#include <iostream>
usingnamespace std;
class teste
{
public:
teste(){x=33;};
~teste(){cout << x << endl;};
int x;
};
int main()
{
teste *x;
for(int i=0;i<10;i++)
x = new teste();
return 0;
}
Each time i call "x = new teste();" the previous object is deleted?
Does this code cause any sort of memory leak?