Код: Выделить всё
class TestClass {
public:
TestClass() {
printf( "TestClass()\n" );
}
~TestClass() {
printf( "~TestClass()\n" );
}
};
int main() {
int a, b, c;
{
TestClass *test = new TestClass();
}
}
TestClass()
Значит, он не вызывает деструктор TestClass, но почему? Если я вызову его вручную (
Код: Выделить всё
delete testПодробнее здесь: https://stackoverflow.com/questions/180 ... th-the-new
Мобильная версия