I have a class that looks like:
class Foo
{
public:
Foo();
virtual ~Foo();
private:
Odp* bar;
};
I wish to initialize bar
to NULL
. Is this the best way to do it?
Foo::Foo() : bar(NULL)
{
}
Also, is it necessary that the destructor is virtual? (If that is true, then must the constructor be virtual as well?)