I just wanted to do some experiment with inheritance and virtual destructor, though before that I tested the base class with the code below, and noticed that no output appears in the console.
Why is that? Is the compiler being super smart about it?
#include <iostream>
using namespace std;
class Animal {
public:
Animal() {
cout << "Animal Constructor Called" << endl;
};
~Animal() {
cout << "Animal Destructor Called" << endl;
};
};
int main()
{
{
Animal Seal();
}
return 0;
}
↧