• Tutorials
  • Courses
  • Tracks

C++ | Destructors | Question 6

Last Updated :
Discuss
Comments

What will be the output?

C++
#include <iostream>
class Test {
public:
    ~Test() {
        std::cout << "Destructor called\n";
    }
};

int main() {
    Test t1;
}


No output

Destructor called

Compilation error

Runtime Error

Share your thoughts in the comments