If you have a loop like:
int i = 0;
while (i < 100)
{
MyClass mc = "abcd";
// do something...
i++;
}
In each iteration, it calls the constructor for class MyClass. Does it also automatically call the destructor, and remove MyClass from memory before continuing to the next iteration?
I would think it does, since the object "mc" is named the same thing in each iteration of course.
Start Free Trial